【发布时间】:2019-07-18 13:56:23
【问题描述】:
在 Azure 发布管道中,我尝试下载存储在 Azure KeyVault 中的密码,然后在调用 Azure 应用函数时将该密码作为参数传递。
我在 Azure 中创建了一个发布管道,其中包含 3 个任务;前两个在代理上运行:
1. Deploy an Azure Function App
2. Download secrets from an Azure Key Vault.
最终任务作为无代理作业运行:
3. Invoke Azure Function
我正在下载的秘密名称是e-password。
在调用 Azure 函数时的查询参数中,我添加了以下内容:
`password=$(e-password)`
我希望从 Key Vault 下载的密钥的值被替换,但调用的 URL 却是:
`https://<my app's name>.azurewebsites.net/api/HttpTrigger?password=$(e-password)`
e-password 的值未被替换。
【问题讨论】:
-
我对 Azure 管道不是很熟悉,但是我们直接在 Azure 函数应用设置中存储密钥保管库机密会是一种解决方法吗?
-
查看 this section 在 Azure Pipelines 中设置和检索变量。从您提供的代码和步骤来看,您似乎没有设置变量,而是希望它被隐式设置。 Custom Variables 部分也值得一试。
标签: azure azure-functions azure-pipelines azure-keyvault