0

网络核心应用程序。我已经为资源创建创建了 arm 模板。在模板中,我传递了如下变量。

"siteConfig": {
                    "appSettings": [
                      {
                        "name": "AzureAd:Authority",
                        "value": "https://login.microsoftonline.com/"
                      },
                      {
                        "name": "AzureAd:TenantId",
                        "value": "[parameters('azureAdTenantId')]"
                      },
                      {
                        "name": "AzureAd:ClientId",
                        "value": "[parameters('azureAdAppId')]"
                      },
                      {
                        "name": "Logging:LogLevel:Default",
                        "value": "Warning"
                      },
                      {
                        "name": "EnableSwagger",
                        "value": "true"
                      },
                      {
                        "name": "AllowedHosts",
                        "value": "*"
                      },
                      {
                        "name": "AzureSQLConnectionString",
                        "value": "server=myconnstring"
                      }
                    ],
                    "alwaysOn": true
                  
            }

下面是参数

"azureAdTenantId": {
            "type": "string",
            "defaultValue": "myid",
            "metadata": {
              "description": "desc"
            }
          },
          "azureAdAppId": {
            "type": "string",
            "defaultValue": "myid",
            "metadata": {
              "description": "desc"
            }
          }

然后我的 appsettings.json 文件中有以下配置

{
  "AzureAd": {
    "Authority": "https://login.microsoftonline.com/",
    "TenantId": "mytenantid",
    "ClientId": "myclientid"
  }
}

然后我在 azure devops 中创建了发布管道来部署我的 webapi 应用程序。它使我陷入错误

2020-07-17T13:17:58.4644065Z ##[error]Error: Failed to update App service 'WebApi' application settings. Error: BadRequest - AppSetting with name 'AzureAd:Authority' is not allowed. (CODE: 400)

在进行部署时我不应该在 appsettings 中传递值,因为我的 arm 模板运行并且它已经创建了 appsettings 并放置了值。我并没有真正找到我在这里缺少的东西?有人可以帮我解决这个问题吗?任何帮助,将不胜感激。谢谢

4

0 回答 0