Running Python Azure Functions Locally on an M1/M2 Mac
5 min readMay 24, 2023
Python-based Azure functions are a powerful tool for executing pieces of code or ‘functions’ in response to specific events. However, for developers who are using the latest M1 and M2 Mac machines, running Azure functions locally has posed a challenge due to the shift from Intel to ARM architectures. The latest Azure Function Core Tools still do not support the ARM architecture (Azure Function Core Tools v4).
It is not too easy to find a solution by googling and even Azure forums do not help much. Three solutions have been identified,
- Use a virtual machine environment that has the capability of emulating an x86/amd64 machine and running an x86/amd64 VM. This is not ideal as currently, Parallels does not support x86/amd64 emulation. This leaves users with less popular options on MacOS like QEMU.
- Install Homebrew twice. It is possible to run the MacOS terminal and some other terminals under Rosetta 2 emulation. This allows an x86/amd64 version of Homebrew to be installed. Then homebrew can be used to install an x86/amd64 version of the Azure Function Core Tools. Again, not the cleanest solution, especially if Homebrew is used for ARM also. Fortunately, x86/amd64 and ARM Homebrew installs are in different places. Some specific settings will be required to pick up the right version of the tools for development. A very good write-up on this method can be found at http://issamben.com/running-python-azure-function-locally-on-an-m1-m2/.