Search code examples
pythonazuremacosapple-m1rosetta

how to install azure functions on apple M1 pro, facing issues when installed with Rosetta


I just had my first Mac book but that too with M1 processor and since then I am struggling with software compatibility issues.

Considering that I dont have much experience with Mac, I really need some help in resolving this issue.

I want to run azure functions on VS Code locally and for that, I need python, VS Code and azure tools but I kept on getting errors saying that Architecture ARM is not supported for language python.

I tried with python 3.8, 3.9 and 3.10 (3.10 was not accepted by VS Code.)

So, now what I understand is that using Rosetta, we can use the same softwares which we use on intel processor, so I followed below protocol for that.

  1. installed Rosetta : /usr/sbin/softwareupdate --install-rosetta
  2. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. cd ~/Downloads
  4. mkdir homebrew
  5. curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
  6. sudo mv homebrew /usr/local/homebrew
  7. export PATH=$HOME/bin:/usr/local/bin:$PATH
  8. Let’s add an alias and path in the ~/.zshrc file:

-If you come from bash you might have to change your $PATH.

-need this for x86_64 brew

export PATH=$HOME/bin:/usr/local/bin:$PATH alias axbrew='arch -x86_64 /usr/local/homebrew/bin/brew'

LINK I referred for this: https://medium.com/mkdir-awesome/how-to-install-x86-64-homebrew-packages-on-apple-m1-macbook-54ba295230f

  1. Now you can install apps for Intel processors: axbrew install package-name

so, now I thought I am finally done.

  1. I installed python -> axbrew install [email protected]
  2. I downloaded VS Code Universal.
  3. ran the function, it threw error for "you must have download azure function core tools". Used below commands to download it : -[![enter image description here][1]][1]
[![enter image description here][2]][2]

but still I keep getting this error from VS Code. VS code doesnt recognize the azure tools functions I installed.

I tried with VSCode universal, for intel etc, but still the same.

Any leads on why I am facing this issue and how to come out of it.

VS Code error


Solution

  • After all the research, I was able to solve this problem by uninstalling the azure tools which I installed thorugh home brew, and installing through npm. this solved my problem. I am not sure why but it did. below are the steps i used. enter image description here