简体   繁体   中英

Azure Function Python docker container: Unable to find an Azure Storage connection string to use for this binding

I'm having trouble getting my Azure Function (python, timer trigger) to work in a docker container. Outside of the docker container, everything works just fine. But as soon as I start my container, I get an error saying:

fail: Host.Startup[515] A host error has occurred System.InvalidOperationException: Unable to find an Azure Storage connection string to use for this binding.

My connection string is defined in my local.settings.json. I have no clue as to why this isn't working in the docker container, has anyone dealt with this? I appreciate any direction, thank you.

Edit: Just a clarification, this is happening on my local machine. I have not deployed yet.

As I said before, I defined my connection string in my local.settings.json. I ended up accessing the file system of the container, and verified that my local.settings.json was in fact in there. I ended up adding my connection string as an env variable in my docker file (AzureWebJobsStorage={YOURCONNNECTIONSTRINGHERE}) and got it working. Hopefully this helps someone who comes across this issue.

The explanation is in this github issue.

Basically local.settings.json is only used by the local CLI, it's totally ignored by the runtime

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM