0

net core application. I have created arm template for resource creation. In template I have passed variables like below.

"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
                  
            }

Below are parameters

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

Then I have below configurations in my appsettings.json file

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

Then I created release pipeline in azure devops to deploy my webapi app. It throws me below error

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)

When doing deployment Do I should not pass values in appsettings because my arm template runs and it already created appsettings and put values. I am not really finding what I am missing here? Can someone help me to fix this? Any help would be appreciated. Thank you

Chamberlain
  • 881
  • 5
  • 17
Niranjan godbole
  • 721
  • 3
  • 13
  • 28

0 Answers0