2017-07-25 9 views
1

私はAzure Automation用のARMテンプレートを作成しており、カスタムモジュールをアップロードしたいと考えています。下の例では、パブリックモジュールをアップロードして、モジュールのURLを与えているのを見ました。どのように私はカスタムモジュールを取るようにこれを変更するのですか?カスタムテンプレートをARMテンプレートに追加する方法

"resources": [ 
       { 
        "name": "[concat(parameters('automationAccountName'), '/', variables('dscModules').xNetworking.ModuleName)]", 
        "type": "microsoft.automation/automationAccounts/Modules", 
        "apiVersion": "[variables('automationApiVersion')]", 
        "tags": {}, 
        "dependsOn": [ 
         "[concat('Microsoft.Automation/automationAccounts/', parameters('automationAccountName'))]" 
        ], 
        "properties": { 
         "contentLink": { 
          "uri": "[variables('dscModules').xNetworking.ModuleUri]" 
         } 
        } 
       } 

答えて

0

blog:Deploy Custom Azure Automation Integration Modules Using ARM Templatesを参照してください。次のテンプレートを使用して、カスタムモジュールをAzureオートメーションアカウントにデプロイすることができます。

$parameters = @{ 
    'moduleName' = 'myModule' 
    'moduleUri' = 'https://github.com/rchaganti/armseries/raw/master/MyModule.zip' 
    'automationAccountName' = 'shuitest' 
    'automationAccountType' = 'Existing' 
    'TemplateFile' = 'D:\xuexi\automation.json' 
} 

注:あなたはthisからtemplatelinkを得ることができる

{ 
    "$schema": "http://schemas.microsoft.org/azure/deploymentTemplate?api-version=2015-01-01-preview#", 
    "contentVersion": "1.0", 
    "parameters": { 
    "automationAccountType": { 
     "type": "string", 
     "allowedValues": [ 
     "New", 
     "Existing" 
     ] 
    }, 
    "automationAccountName": { 
     "type": "string" 
    }, 
    "moduleName": { 
     "type": "string" 
    }, 
    "moduleUri":{ 
     "type": "string" 
    } 
    }, 
    "variables": { 
    "templatelink": "[concat('https://raw.githubusercontent.com/rchaganti/armseries/master/', parameters('automationAccountType'), 'AccountTemplate.json')]" 
    }, 
    "resources": [ 
    { 
     "apiVersion": "2015-01-01", 
     "name": "nestedTemplate", 
     "type": "Microsoft.Resources/deployments", 
     "properties": { 
     "mode": "incremental", 
     "templateLink": { 
      "uri": "[variables('templatelink')]", 
      "contentVersion": "1.0" 
     }, 
     "parameters": { 
      "accountName": { 
      "value": "[parameters('automationAccountName')]" 
      }, 
      "accountLocation": { 
      "value": "[resourceGroup().Location]" 
      }, 
      "moduleName": { 
      "value": "[parameters('moduleName')]" 
      }, 
      "moduleUri": { 
      "value": "[parameters('moduleUri')]" 
      } 
     } 
     } 
    } 
    ] 
} 

パラメータは、以下の単なる一例である必要があります。

また、answerを参照することもできます。

関連する問題