gpt4 book ai didi

Azure Bicep( key 保管库 secret 作为参数传递给本地变量)

转载 作者:行者123 更新时间:2023-12-03 05:19:34 25 4
gpt4 key购买 nike

我是 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com