Azure DevOps 变量组未在 Azure 函数配置中应用

标签 azure azure-devops

我正在尝试利用 Azure DevOps 中的变量组功能。

我已在发布管道中创建了变量组并已关联。但是,当我将代码发布到Azure中的Function App时;当我转到功能应用程序中的配置设置时,自定义设置不存在。

在让这些显示出来方面我是否缺少一个步骤?

enter image description here

enter image description here

enter image description here

enter image description here

更新:修复此问题;我需要编写变量。这就是我所做的步骤。

enter image description here

最佳答案

我通常在发布新代码后使用 powershell 任务来执行此操作。因此,添加一个新的 powershell 任务并将其定义为内联:

$appname = "name of your function app"
$rg = "name of resource group"
$webApp = Get-AzureRmwebApp -ResourceGroupName $rg -Name $appname
$webAppSettings = $webApp.SiteConfig.AppSettings
$hash = @{}
foreach ($setting in $webAppSettings) {
    $hash[$setting.Name] = $setting.Value
}
$hash['New name'] = $("pipelineVariable")
Set-AzureRMWebAppSlot -ResourceGroupName $rg -Name $appname -AppSettings $hash -Slot production

PS:也将部署槽定义为变量

关于Azure DevOps 变量组未在 Azure 函数配置中应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60193501/

相关文章:

visual-studio - 将 iisexpress 连接到启用安全性的 azure sql 数据库

c# - 如何引用和上传Azure Blob存储中的文件?

npm - 为 NPM 构建步骤设置环境变量

Azure DevOps ARM 模板 - 覆盖链接服务参数

git - Azure cli 存储库导入失败,操作返回 400 状态代码

azure - 是否可以在我的 ARM 模板中检索 oms 工作区 ID

azure-devops - Azure DevOps 代码搜索不支持以通配符为前缀的查询

c# - 设置 web.config 进行部署 - .Net

c# - 从azure中的webjobs读取webapp的web.config

azure - 是否可以在客户端凭据流程中添加自定义声明?