Azure Functions Database Connection String

Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Azure Functions Database Connection String

Message par Clippy »

Azure Functions Database Connection String
Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Re: Azure Functions Database Connection String

Message par Clippy »

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 »