0

I have below appsettings for asp.net core 3.1 web application,

 {
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "msidentitysamplestesting.onmicrosoft.com",
"TenantId": "7f58f645-c190-4ce5-9de4-e2b7acd2a6ab",
"ClientId": "86699d80-dd21-476a-bcd1-7c1a3d471f75",

"ClientCertificates": [
  {
    "SourceType": "KeyVault",
    "KeyVaultUrl": "https://msidentitywebsamples.vault.azure.net",
    "KeyVaultCertificateName": "MicrosoftIdentitySamplesCert"
  }
  ]
}
}

I deployed the web app over Azure as app service and trying to override appsettings values with App Service configuration - Application Settings.

For "Instance", I am using "AzureAd:Instance" and it's working, I am able to override the value.

enter image description here

But for "KeyVaultUrl", "SourceType", "KeyVaultCertificateName", which comes under "ClientCertificates" with one more level depth, how to prepare the key?

I tried both "AzureAd:ClientCertificates:SourceType" and "AzureAd:SourceType", but both NOT working. What will be the key name, how I can override it? Thanks!

user584018
  • 10,186
  • 15
  • 74
  • 160
  • 1
    you can use two different files for dev and prod environment: appsettings.development.json and appsettings.production.json – zolty13 Jul 14 '20 at 09:28
  • https://stackoverflow.com/questions/46364293/automatically-set-appsettings-json-for-dev-and-release-environments-in-asp-net-c/50331886#50331886 – zolty13 Jul 14 '20 at 09:30

0 Answers0