Ich brauche einen DSC-Konfigurationsparameter ([PSCredential] RegistrationKey) zu schützen, so habe ich es ausdrückte unter "settings.protectedSettings.configurationData" so:ARM Template DSC: Konfiguration nicht 'sehen' protectedSettings.configurationArguments
"protectedSettings": {
"configurationArguments": {
"RegistrationKey": {
"UserName": "PLACEHOLDER_DONOTUSE",
"Password": "[parameters('dscAutomationRegistrationKey')]"
}
},
"configurationUrlSasToken": "[parameters('artifactsLocationSasToken')]"
}
ich den Fehler:
"VM has reported a failure when processing extension 'Microsoft.Powershell.DSC'. Error message: \"The DSC Extension failed to execute: Mandatory
parameter RegistrationKey is missing.
Wenn ich RegistrationKey aus „settings.protectedSettings.configurationArguments
“, in „settings.configurationArguments
“ bewegen, es funktioniert, also nehme ich an, es ist nichts falsch mit der Syntax, so dass ich glaube, es ist mitzu tun, die nicht in der DSC-Konfiguration enthalten war.
(Ich habe versucht, den Konfigurationsblock in der PS1-Datei aufgenommen werden, aber dies auf einen Fehler warf, was darauf hindeutet, dies nicht getan werden kann)
ich jetzt eine Konfigurationsdaten PSD1-Datei geschrieben, die folgende enthält:
$ConfigData = @{
AllNodes = @(
@{
NodeName = "*"
PsDscAllowPlainTextPassword = $true
}
)
}
und referenzierte es in settings.configurationdata.url
.
Dies ergibt sich nun im gleichen Fehler wie zuvor: VM einen Fehler gemeldet hat ...
Die ARM-Vorlage wird von Powershell genannt:
$oAutomationAccount = Get-AzureRmAutomationAccount -ResourceGroupName $AAresourceGroupName -Name $AutomationAccountName
$RegistrationInfo = $oAutomationAccount | Get-AzureRmAutomationRegistrationInfo
$DscRegKeyString = $RegistrationInfo.PrimaryKey
$ssDscAutomationRegistrationKey = (ConvertTo-SecureString -string $DscRegKeyString -AsPlainText -Force)
#Automation Account EndPoint Uri
$DscRegistrationUrl = $RegistrationInfo.Endpoint
$params = @{
artifactsLocationSasToken = $TemplateSas
vmName = "XYZ"
dscAutomationRegistrationKey = $ssDscAutomationRegistrationKey
dscAutomationRegistrationUrl = $DscRegistrationUrl
dscNodeConfigurationName = "CreateAFolder.localhost"
dscTimeStamp = (Get-Date -f "MM/dd/yyyy H:mm:ss tt") #"MM/dd/yyyy H:mm:ss tt"
dscResourceUrl = $DscResourceUrl
dscConfigurationUrl = $DscConfigurationUrl
dscResourceScript = $DscResourceScriptName
dscResourceFunction = "ConfigureLCMforAAPull"
#sequenceId = $sequenceId
}
New-AzureRmResourceGroupDeployment @params `
-Name "$TemplateInstance-$branch" `
-ResourceGroupName $DeploymentResourceGroup.ResourceGroupName `
-Mode Incremental `
-DeploymentDebugLogLevel All `
-TemplateUri $TemplateUri `
-Verbose
Wo ich die Parameter glauben geben werden als die richtigen Typen.
Was mache ich falsch?
Referenzvorlage: https://github.com/Azure/azure-quickstart-templates/blob/master/dsc-extension-azure-automation-pullserver/azuredeploy.json
ein neueres DSC-Schema verwenden aktualisiert: https://blogs.msdn.microsoft.com/powershell/2016/02/26/arm-dsc-extension-settings/