Running Python Azure Function Locally on an M1

Currently, the Azure Function Tools do not support Python functions on an M1. There is an ongoing process to update the tools in the future. When trying to start the python function, you will receive an error message like the following:

Microsoft.Azure.WebJobs.Script: Architecture Arm64 is not supported for language python.

Meanwhile, it is necessary to implement a workaround to get the function up and running. Below, you will find the instructions to set up your primary environment, including Python, Node version manager, Node, and Azure Function Tools.

After that, I could finally run my Azure Function locally by using the command func start.

Resources:

4 responses to “Running Python Azure Function Locally on an M1”

  1. Ionut Adrian Rotaru Avatar
    Ionut Adrian Rotaru

    Hey. Unfortunately overriding the cygrpc package is failing with this error. Can you help me figure this out? `/opt/homebrew/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-darwin.so: No such file or directory`

    1. Andreas Katzian Avatar
      Andreas Katzian

      Hi Adrian, did you ensure you have python 3.9 installed? Also checkout the content of the directory /opt/homebrew/lib/python3.9/site-packages/grpc/_cython.

      1. Enrique Altuna Avatar
        Enrique Altuna

        I am having the same issue. Seems Python 3.9 libs are in a different location:

        Requirement already satisfied: grpcio in ./Library/Python/3.9/lib/python/site-packages (1.56.0)

        1. Enrique Altuna Avatar
          Enrique Altuna

          After following the instructions, when I search the file system for cygrpc.cpython-39-darwin.so, I can only find one inside the node modules.

Leave a Reply to Ionut Adrian Rotaru Cancel reply

Your email address will not be published. Required fields are marked *