gpt4 book ai didi

azure - 如何通过二头肌将应用程序配置设置粘贴到暂存槽

转载 作者:行者123 更新时间:2023-12-02 06:14:38 24 4
gpt4 key购买 nike

如何通过二头肌将应用程序配置设置粘贴到插槽?

这是我的二头肌文件:

var stagingSettings = [  
{
name: 'AzureFunctionsJobHost__extensions__durableTask__hubName'
value: 'staging'
slotSetting: true
}
]


resource functionApp 'Microsoft.Web/sites/slots@2018-11-01' = {
name: name
kind: kind
location: location
properties: {
clientAffinityEnabled: true
enabled: true
httpsOnly: true
serverFarmId: resourceId('Microsoft.Web/serverfarms', servicePlanName)
siteConfig: {
use32BitWorkerProcess : false
appSettings: stagingSettings
}
}
identity: {
type: 'SystemAssigned'
}
}

在部署此代码时,我没有看到应用程序配置设置粘在插槽上:

enter image description here

复选框未选中。我错过了什么?

最佳答案

您需要创建一个slotConfigNames资源:

Names for connection strings, application settings, and external Azure storage account configurationidentifiers to be marked as sticky to the deployment slot and not moved during a swap operation.This is valid for all deployment slots in an app.

类似的东西应该有效:

param functionAppName string

resource functionApp 'Microsoft.Web/sites@2018-11-01' existing = {
name: functionAppName
}

resource functionApps 'Microsoft.Web/sites/config@2021-03-01' = {
name: 'slotConfigNames'
parent: functionApp
properties: {
// Sticky app settings
appSettingNames: [
'AzureFunctionsJobHost__extensions__durableTask__hubName'
]
}
}

关于azure - 如何通过二头肌将应用程序配置设置粘贴到暂存槽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71888548/

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