答案 0 :(得分:1)
我收到了同样的错误,但在一些恶作剧之后,它对我有用。重要的部分是settings/Properties/SqlAgentCred/password
对protectedSettings/Items/AgentPassword
的引用。下面是我的模板中的Powershell.DSC扩展资源下的属性节点。
"properties": {
"publisher": "Microsoft.Powershell",
"type": "DSC",
"typeHandlerVersion": "2.17",
"autoUpgradeMinorVersion": false,
"settings": {
"ModulesUrl": "https://blobstore.blob.core.windows.net/windows-powershell-dsc/DBServer.ps1.zip",
"ConfigurationFunction": "DBServer.ps1\\DBServer",
"Properties": {
"SqlAgentCred": {
"userName": "user@domain.com",
"password": "PrivateSettingsRef:AgentPassword"
}
},
"WmfVersion": "latest",
"Privacy": {
"DataCollection": "Disable"
}
},
"protectedSettings": {
"Items": {
"AgentPassword": "Pa$$word"
},
"DataBlobUri": ""
}
}
答案 1 :(得分:0)
您将在protectedsettings部分指定受保护的设置。 ProtectedSettings下的任何内容都是加密发送的。查看https://blogs.msdn.microsoft.com/powershell/2016/02/26/arm-dsc-extension-settings/了解详情。