Adding env variable to app service and to connect with azure sql azure database

Varma 1,385 Reputation points
2024-07-09T10:40:28.28+00:00

Adding environment variable to the app service with the name of the SQL server database to allow app service to connect with it. Please suggest how we can achieve this.

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

1 answer

Sort by: Most helpful
  1. akinbade abiola 18,715 Reputation points
    2024-07-09T10:47:42.7466667+00:00

    Hello Varma,

    Thanks for your question.

    To achieve this, you will need app settings

    1. Click on the "Application settings" tab.
    2. Scroll down to the "Application settings" section and click on "New application setting".
    3. Enter the name for the env variable as well as value
    4. In your code you can then retrieve the app settings how u want to

    See: https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola


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.