I get the error "program '/functions_debugging_cli/func' does not exist" when trying to run an azure function app locally in a docker container. Browsing the docker image I learned that the /functions_debugging_cli/
folder doesn't exist, so that figures. Question is: why isn't this there in the image in the first place, and how can I get it there?
Software used:
- Docker Deskop for Windows installed (my version: 4.27.1, client 25.0.2, server 25.0.2), using WSL2
- Visual Studio 2022 LTSC 17.8
Reproduction steps:
- Create an Azure Function app in VS
- Wait for AzureFunctionsTools to install
- Select .NET8.0 Isolated (Long Term Support)
- Select Queue Trigger (in my case at least)
- Enable Docker
- Fill in other required field and finish
- Update nuget packages (why are these not already the latest versions? Else the next step fails...)
- Add the
Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues
package (why is this missing, resulting in an immediate build error with boilerplate code?)
- Build solution and debug as Docker. Wait for everything to get setup and then I get the error.
Trying to find a solution for this error, I found this SO answer: https://stackoverflow.com/a/66545118 which looked to be a promising direction. Logging into the newly created docker container (using docker exec -t -i {container name} /bin/bash
in a command prompt) I tried to get the azure function tools installed manually first, to see if this was viable, using some adapted steps from here: https://github.com/Azure/azure-functions-core-tools/blob/master/README.md#azure-functions-core-tools
Apparently, the docker container runs Debian 12. That website only goes to 11 and assumes some packages are already installed. Also, Microsoft has this link for Debian 12 repositories: https://packages.microsoft.com/config/debian/12/
Since Debian 12 handles signing new repositories a little different, I ended up using the following script, instead of what was mentioned for Debian10/11:
DEBIAN_VERSION=12
apt-get install -y wget
apt-get install -y curl
apt-get install -y gpg
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
cp usr/share/keyrings/microsoft-prod.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/debian/$DEBIAN_VERSION/prod.list
mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
chown root:root /etc/apt/trusted.gpg.d/microsoft-prod.gpg
chown root:root /etc/apt/sources.list.d/microsoft-prod.list
After this, running apt-get update
recognizes the new repository, but unfortunately it still doesn't recognize the azure functions tools package, so apt-get install azure-functions-core-tools-3
still fails.
After that, I also tried targetting the version 11 repository instead. This one DOES contain the tools package, but then running func
results in an error mentioning Couldn't find a valid ICU package installed on the system
which supposedly should be the libicu*
package (* being either -dev
or 72
in this specific version of the image). Installing that doesn't resolve that error, and also starting/debugging the function app itself in the container still yields the same error as in the start, so that solves nothing either.
I'm at a loss at this point. How do I get a linux docker image properly setup with the required azure function tools installed as well?