App Service not saving environment variable SENDGRID_API_KEY – value returns null

Youc 20 Reputation points
2025-05-09T04:10:50.41+00:00

Subject: App setting variable SENDGRID_API_KEY not recognized in Azure App Service – value returns null

Description: Hi Microsoft Support,

We have deployed a .NET-based email API (isupplier-emailapi) using Azure App Service under the resource group youUIGrp. We have set the SENDGRID_API_KEY both through the Azure Portal (under Environment Variables) and CLI:

az webapp config appsettings set --name isupplier-emailapi --resource-group youUIGrp --settings "SENDGRID_API_KEY=SG.xxxxxx"

However, our deployed application cannot read this environment variable at runtime. It returns null, resulting in an error: "Missing SENDGRID_API_KEY"

We’ve also tried:

Setting via CLI multiple formats (--settings key=value, JSON, etc.)

Restarting the app

Verifying the variable appears in the App Settings list

The value is still not picked up. Could you please investigate and fix this for us? We’re happy to provide access or any additional details you need.

Thank you,

Kate Trieu

******@youc.com.au

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,767 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.