Adding Azure Functions Support to a Devcontainer
I already had a dev container set up and needed to add Azure Functions Core Tools to it. This is the approach that finally worked for me.
The Challenge
I needed to add support for Azure Functions to my existing Dev Container. I tried a few approaches and hit errors along the way. After some digging through the docs and a bit of trial and error, I landed on a version that rebuilt cleanly.
The Solution
To begin, I attempted to add the following lines to my Dockerfile:
That version failed when I rebuilt the container. After searching around and comparing a few examples, I landed on this RUN command:
| |
This successfully rebuilt the container image and had the Azure Functions Core Tools installed.
Next, I added the following extensions to the devcontainer.json file:
| |
With that in place, I had a working dev container with Azure Functions Core Tools and the Visual Studio Code extensions I needed.
References:
Use a Docker container as a development environment with Visual Studio Code
Work with Azure Functions Core Tools
Azure Functions Core Tools
