I have this local.settings.json in my local Azure function (Timer trigger)
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "python",
.
.
.
},
"ConnectionStrings": {
"sql_server": "valid connection string"
}
}
I managed to access the connection string locally using:
conn = os.environ["ConnectionStrings:sql_server"]
and my code runs okay.
But, when I deploy I get ‘Failure Exception: KeyError: ‘sql_server’ […] getitem raise KeyError(key) from None’.
I tried to execute in portal changing that line to:
conn = os.environ["sql_server"]
But nothing changed.
Does anyone know how I can call this method on Azure Web?
María Casasola Calzadilla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.