自动生成 Key Vault Secret

Generate Key Vault Secrets automatically

我们需要创建 Key Vault 并使用机密填充(或生成)它,然后在下一步构建步骤中将它们作为 SQL 服务器 (PaaS) 的密码引用。这样做的最佳方法是什么?

有很多方法可以create/updateAzure Key Vault,例如Azure PowerShell, Azure CLI、REST API,还有VSTS中的Azure PowerShell和Azure CLI任务build/release .使用 Azure PowerShell 或 Azure CLI 也可以。

到create/updatebuild/release中的变量,可以使用Logging Command##vso[task.setvariable]value),那么这个变量就可以在后面的任务中使用了。

另一方面,如果您只想要变量 secret,您只需添加构建或发布变量并单击锁定图标到 set the variable secret