为我们的数据库设置连接字符串时,AzureAppServiceSettings 失败

标签 azure azure-devops azure-web-app-service azure-resource-manager

我遇到一个问题,即在使用任务 AzureAppServiceSettings@1 运行 yaml 管道来设置数据库服务器的连接字符串时,我在 Azure Devops 实例上不断收到此错误。

- task: AzureAppServiceSettings@1
  displayName: 'Dev app service settings'
  inputs:
    azureSubscription: '**subscriptionName**'
    appName: '**appName**'
    resourceGroupName: '**resourceGroupName**'
    connectionStrings: |
      [
        {
          "name": "DefaultConneciton",
          "value": "Server=tcp:**serverName**,1433;Initial Catalog=**dbName**;Persist Security Info=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication=\"Active Directory Default\";",
          "type": "SQLAzure",
          "slotSetting": false
        }
      ]

运行任务后会抛出此错误:

##[error]Error: Failed to update App service 'appName' Connection Strings. Error: BadRequest - The parameter properties has an invalid value. (CODE: 400)

我还尝试通过 Azure 资源资源管理器编辑应用设置 并具有相同的输出:

{
    "Code": "BadRequest",
    "Message": "The parameter properties has an invalid value.",
    "Target": null,
    "Details": [
        {
            "Message": "The parameter properties has an invalid value."
        },
        {
            "Code": "BadRequest"
        },
        {
            "ErrorEntity": {
                "ExtendedCode": "51008",
                "MessageTemplate": "The parameter {0} has an invalid value.",
                "Parameters": [
                    "properties"
                ],
                "Code": "BadRequest",
                "Message": "The parameter properties has an invalid value."
            }
        }
    ],
    "Innererror": null
}

我只能通过门户编辑连接字符串。

最佳答案

如果您已在 Azure 门户上添加了连接字符串参数,请尝试在管道或 Azure 门户上将其删除。

如果不起作用,请将 ** 替换为 ''。

关于为我们的数据库设置连接字符串时,AzureAppServiceSettings 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73739599/

相关文章:

azure - Azure Web 应用程序身份验证中的重定向 URI

azure - 在 Bicep 部署中的 AppService 上设置 `customDomainVerificationId` 属性没有效果

azure - Microsoft Intune - 可以取消删除设备的请求吗?

azure - 如何自动垂直缩放网络应用程序

node.js - 目前已禁用 'Web App Bot' 机器人的迁移

azure - 尝试将 SSL 证书部署到 Azure - Webrole 陷入 "Waiting for role to start"

ios - Visual Studio 需要凭据才能在 Mac 上访问 pkgs.dev.azure.com

azure - 适用于 Windows VM 的调用-AzureRMVMRunCommand

Azure 门户显示错误的服务主体对象 ID

azure - 将 Azure 应用服务限制为 IP 白名单而不返回 403