© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•11mo ago•
19 replies
Salman

✅ How to setup environment variables in Azure Web App

I've deployed my Blazor Server App to Azure Web App. And in App settings I've added some items e.g my Cloudinary URL and in Connection Strings section I've made a connection string named as "DefaultConnection" same as it was in my appsettings.json file. However I'm getting some Postgress EFCore error in production.

Here's my Program.cs:
https://paste.mod.gg/ltvubhnjcema/0

My appsettings.json structure:
{
  "ConnectionStrings": {
    "DefaultConnection": ""
  },
  "AuthMessageSenderOptions": {
    "SendGridKey": "",
    "SendGridDomain": ""
  },
  "CloudinaryUrl": "",
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}
{
  "ConnectionStrings": {
    "DefaultConnection": ""
  },
  "AuthMessageSenderOptions": {
    "SendGridKey": "",
    "SendGridDomain": ""
  },
  "CloudinaryUrl": "",
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}


AI told me that the environment variables I set are supposed to override these values but apparently they aren't and I'm not sure how to check. Can someone guide me the correct way to do it. Thanks
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Request Entity Too Large in Azure Web App Production Environment
C#CC# / help
6mo ago
How to setup shared/common data in a web app
C#CC# / help
17mo ago
❔ Environment variables in tests
C#CC# / help
3y ago
✅ How to read Environment Variables in VS Code ?
C#CC# / help
17mo ago