How to add connection string in Azure

This tutorial will discuss the quick steps to add a connection string in Azure.

How to add connection string in Azure

One of the best ways is, You add a connection string for your Azure Function App. To do that, you can follow the below steps

  1. Log in to the Azure Portal.
  2. Navigate to your Azure Function App

3. On the function App page, you can click on the Configuration from the left side menu —> Click on the Application Settings tab from the top and Now click on the + New connection string button as highlighted below to create the new connection string.

azure function app settings

Now, you have created the Connection string for your Azure Function. To read that from your code, you can use the code format below

var myconn = System.Configuration.ConfigurationManager
                 .ConnectionStrings["MyConnection"].ConnectionString;

In this case, if you are trying to use other than the .Net language, then you can use the Application settings With the help of the Environment variable, you can easily able to access the App settings from your code.

You may also like following the articles below

Conclusion

This article discussed how to add a connection string in Azure. Thanks for reading this article !!!