question

ArindamPaulRoy-4561 avatar image
0 Votes"
ArindamPaulRoy-4561 asked ·

Azure WebJobs environment setting

Hi

I have a vanilla .NET Core 3.1 app that I have hosted as a WebJob in Azure App Service.
How do I set the environment name so that it is surfaced to the webjob context when I do -
hostContext.HostingEnvironment.EnvironmentName ?

azure-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Grmacjon-MSFT avatar image
0 Votes"
Grmacjon-MSFT answered ·

Hi @ArindamPaulRoy-4561,

I believe this can be done via the Azure portal.

In the Azure portal, search for and select App Services, and then select your app.

In the app's left menu, select Configuration > Application settings.



9191-app-setting.png

Remember setting app settings in App Service are like setting them in appSettings in Web.config or appsettings.json, but the values in App Service override the ones in Web.config or appsettings.json. You can keep development settings (for example, local MySQL password) in Web.config or appsettings.json, but production secrets (for example, Azure MySQL database password) safe in App Service. Read this doc for more info.


Hope that helps. Please let us know if you have further questions

Thanks,

Grace



app-setting.png (199.2 KiB)
· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ArindamPaulRoy-4561 avatar image
0 Votes"
ArindamPaulRoy-4561 answered ·

Sorry, but what is the setting name that I need to set so that it sets the WebJobs environment name?

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.