Azure / azure-quickstart-templates

Azure Quickstart Templates
https://aka.ms/azqst
MIT License
14.05k stars 16.12k forks source link

[201-vmss-automation-dsc] - Given powershell script fails #1969

Open nitin16 opened 8 years ago

nitin16 commented 8 years ago

I have noticed poweshell script example provided passes template parameter files and dynamic variables which are used in template.

` $RegistrationInfo = Get-AzureRmAutomationRegistrationInfo -ResourceGroupName $ResourceGroupName -AutomationAccountName $AccountName

New-AzureRmResourceGroupDeployment -Name TestDeployment -ResourceGroupName $ResourceGroupName -TemplateFile .\azuredeploy.json -TemplateParameterFile .\azuredeploy.parameters.json -registrationKey ($RegistrationInfo.PrimaryKey | ConvertTo-SecureString -AsPlainText -Force) -registrationUrl $RegistrationInfo.Endpoint -automationAccountName $AccountName -jobId (New-GUID) -adminUsername $credential.UserName -adminPassword $credential.Password -domainNameLabel $DomainNameLabel -Verbose `

For some reason it throws an error when i try to run same through powershell ISE and get error saying registrationKey is not valid parameter.

Is there something I need to install before I run this script?

singhkays commented 8 years ago

@mgreenegit Can you take a look at this question?

nitin16 commented 8 years ago

I am pass this error, For some reason it was not finding deployment template.

I am getting following error though. not much information about error.

New-AzureRmResourceGroupDeployment : 11:45:38 AM - Resource microsoft.automation/automationAccounts/Modules 'AutomationAccount3/xNetworking' failed with message 'The resource operation completed with terminal provisioning state 'Failed'.' At C:\Users\nitinb\Source\Play area\ARM-ScaleSetmanagedbyAADSC\psDeploy.ps1:20 char:1

nitin16 commented 8 years ago

I see this in extension configuration, should we need to update it for actual key passed though parameters?

{ "Name": "RegistrationKey", "Value": { "UserName": "PLACEHOLDER_DONOTUSE", "Password": "PrivateSettingsRef:registrationKeyPrivate" }, "TypeName": "System.Management.Automation.PSCredential" },

singhkays commented 8 years ago

@nitin16 That's what it seems like. You need to supply values to the parameter https://github.com/Azure/azure-quickstart-templates/blob/master/201-vmss-automation-dsc/azuredeploy.json#L75