0 votes
in Azure Function by
What is Azure Functions Database Connection String?

1 Answer

0 votes
by

We can access an external database to execute the function.

{

  "IsEncrypted": false,

  "Values": {

    "AzureWebJobsStorage": "UseDevelopmentStorage=true;",

    "AzureWebJobsDashboard": ""

  },

  "ConnectionStrings": {

    "MyConnectionString": "[YourConnectionStringHere]"

  }

}

This allows us to use the ConfigurationManager.ConnectionStrings[] we are all used to.

var sqlConnection = ConfigurationManager

                   .ConnectionStrings["MyConnectionString"].ConnectionString;

...