从ARM模板传递参数值到DSC配置 [英] Passing Parameter Values to DSC Configuration from ARM Template
问题描述
我有一个简单的DSC Config文件,其中包含凭证和字符串输入参数.我希望此DSC配置与在ARM模板中部署的VM一起部署,但是缺少如何安全地传递这两个参数的概念.我该怎么做?
I have a simple DSC Config file that contains a credential and string input parameter. I want this DSC configuration deployed with a VM deployed in an ARM template but am missing the concept of how to pass these two parameters securely. How do I accomplish this?
推荐答案
我收到了同样的错误,但是经过一些恶作剧之后,它为我工作了.重要的部分是对protectedSettings/Items/AgentPassword
的settings/Properties/SqlAgentCred/password
引用.以下是模板中Powershell.DSC扩展资源下的属性节点.
I was receiving the same error but, after some shenanigans, it is working for me. The important part is the settings/Properties/SqlAgentCred/password
reference to protectedSettings/Items/AgentPassword
. Below is the properties node under my Powershell.DSC extension resource in my template.
"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": ""
}
}
这篇关于从ARM模板传递参数值到DSC配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!