5
votes

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.

2

2 Answers

5
votes

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.

0
votes

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