arraysjsonazure-devopsazure-logic-appsazure-pipelines-yaml

Task AzureAppServiceSetting@1: Application Settings object is not a valid JSON while deploying with YAML file from Azure Devops


I am trying to deploy an environment variable for the standard logic application with the YAML file using the AzureApServiceSettings@1 task.

One of the values has a JSON value.

[{"company_id":"TEST","id":"TEST","url_basic":"https://www.google.com/"}]

      [
        {
        "name":"Connection",
        "value": "$(Connection)",
        "slotSetting":false
        },
      ]

When I deploy those settings I am getting the error "Application Settings object is not a valid JSON"

I run out of options and hope that one of you can help me to find the right way to deploy.


Solution

  • You need to escape the quotation marks in your JSON:

    variables:
      - name: Connection
        value: '[{\"company_id\":\"TEST\",\"id\":\"TEST\",\"url_basic\":\"https://www.google.com/\"}]'
    

    Test YAML pipeline:

    YAML pipeline

    Deployment log:

    Deployment log

    Result:

    Result