作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Azure Bicep 的新手。我正在尝试使用虚拟机 (Window) 凭据的 key 保管库 secret 名称和值。但我在将 key 保管库的名称和值作为参数传递给局部变量时遇到了问题。谁能指导我解决这个问题?
@description('Password for the Virtual Machine.')
@secure()
param adminPassword string = keyVault.getSecret()
最佳答案
您不能在 main.bicep
文件中使用 getSecret()
函数(即作为 defaultValue) - 您只能在二头肌文件。 @Deep 有一个链接...
如果您想将 secret 传递给 main.bicep
,您需要在参数文件中使用参数引用,请参阅:https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-tutorial-use-key-vault#edit-the-parameters-file
关于Azure Bicep( key 保管库 secret 作为参数传递给本地变量),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73409568/
我是一名优秀的程序员,十分优秀!