Azure Functions Database Connection String
Azure Functions Database Connection String
Azure Functions Database Connection String
Re: Azure Functions Database Connection String
Jan_V *almost* nailed it, which led me to experiment with this in the `local.settings.json`
```
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true;",
"AzureWebJobsDashboard": ""
},
"ConnectionStrings": {
"MyConnectionString": "[YourConnectionStringHere]"
}
}
```
This allows you to use the `ConfigurationManager.ConnectionStrings[]` we are all used to.
```
var sqlConnection = ConfigurationManager
.ConnectionStrings["MyConnectionString"].ConnectionString;
```
```
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true;",
"AzureWebJobsDashboard": ""
},
"ConnectionStrings": {
"MyConnectionString": "[YourConnectionStringHere]"
}
}
```
This allows you to use the `ConfigurationManager.ConnectionStrings[]` we are all used to.
```
var sqlConnection = ConfigurationManager
.ConnectionStrings["MyConnectionString"].ConnectionString;
```