MyAutoPack.json
{ "$schema": "http://schemas.microsoft.org/azure/deploymentTemplate?api-version=2015-01-01-preview#", "contentVersion": "1.0", "parameters": { "accountName": { "type": "string", "metadata": { "description": "The name of the Azure Automation account to deploy to." } }, "regionId": { "type": "string", "allowedValues": [ "Japan East", "East US 2", "West Europe", "Southeast Asia", "South Central US" ], "metadata": { "description": "The region to deploy the Automation account in." } }, "credentialName": { "type": "string", "metadata": { "description": "DefaultAzureCredential is the name of the Automation credential used in this runbook. This credential allows you to authenticate to Azure. " } }, "userName": { "type": "string", "metadata": { "description": "The username for the Azure Automation credential." } }, "password": { "type": "string", "metadata": { "description": "The password for the Azure Automation credential." } }, "jobId": { "type": "string", "metadata": { "description": "The GUID for the runbook job to be started." } } }, "variables": { "runbookName": "PublishedRunbook", "scriptUri": "https://raw.githubusercontent.com/azureautomation/automation-packs/e20141d95eaca7560a9d1fff405c3449e30a062e/101-sample-automation-resource-templates/sample-deploy-runbooks/runbooks/PublishedRunbook.ps1", "runbookDescription": "Authenticates to Azure and lists all the Azure V1 VMs", "sku": "Free" }, "resources": [ { "name": "[parameters('accountName')]", "type": "Microsoft.Automation/automationAccounts", "apiVersion": "2015-01-01-preview", "location": "[parameters('regionId')]", "dependsOn": [], "tags": {}, "properties": { "sku": { "name": "[variables('sku')]" } }, "resources": [ { "name": "[variables('runbookName')]", "type": "runbooks", "apiVersion": "2015-01-01-preview", "location": "[parameters('regionId')]", "dependsOn": [ "[concat('Microsoft.Automation/automationAccounts/', parameters('accountName'))]" ], "tags": {}, "properties": { "runbookType": "Script", "logProgress": "false", "logVerbose": "false", "description": "[variables('runbookDescription')]", "publishContentLink": { "uri": "[variables('scriptUri')]", "version": "1.0.0.0" } } }, { "name": "[parameters('credentialName')]", "type": "credentials", "apiVersion": "2015-01-01-preview", "location": "[parameters('regionId')]", "dependsOn": [ "[concat('Microsoft.Automation/automationAccounts/', parameters('accountName'))]" ], "tags": {}, "properties": { "userName": "[parameters('userName')]", "password": "[parameters('password')]" } }, { "name": "[parameters('jobId')]", "type": "jobs", "apiVersion": "2015-01-01-preview", "location": "[parameters('regionId')]", "dependsOn": [ "[concat('Microsoft.Automation/automationAccounts/', parameters('accountName'))]", "[concat('Microsoft.Automation/automationAccounts/', parameters('accountName'), '/runbooks/',variables('runbookName'))]" ], "tags": { "key": "value" }, "properties": { "runbook": { "name": "[variables('runbookName')]" } } } ] } ], "outputs": {} } |