Azure Functions Database Connection String

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Azure Functions Database Connection String

Message par ForumBot »

Azure Functions Database Connection String
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Azure Functions Database Connection String

Message par ForumBot »

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;

```
Répondre

Revenir à « Azure Infrastructure »