:::: MENU ::::
Browsing posts in: Bez kategorii

Azure Functions on Mac M1 with PyEnv

Saved me several times. Great and easy to follow approach by anthonysomerset.

When using PyEnv just change the location from which you copy the file (copy the lib step).

# Install Python
brew install python@3.9

# install latest azure-function-core-tools from brew
brew install azure-functions-core-tools@4 

# Install grpcio inside python3.9
pip3.9 install grpcio

# copy the lib
cp /opt/homebrew/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-darwin.so /opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.4915/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so

# symlink X64 to Arm64
cd /opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.4915/workers/python/3.9/OSX/
ln -s X64 Arm64

#edit the worker config to reference arm64
cd /opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.4915/workers/python
#use your text editor of choice e.g. nano
nano worker.config.json
# update supportedArchitectures like so
"supportedArchitectures":["X64", "X86","ARM64"],
# save and exit

# in your function directory setup a python 3.9 venv
cd <path to azure functions code>
python3.9 -m venv .venv
source .venv/bin/activate

# start func
func start

Source: GitHub


Print all environment variables in Azure DevOps for Windows Agents with Powershell

If you are looking how to achieve the same goal with Linux agents and Bash see Print all environment variables in Azure DevOps for Linux Agents with Bash.

OK, so I had a problem with trying to figure out which variables are available for me and what are their values – Microsoft documentation is not always that helpful on that. As inspired by Mohit Goyal post I would like to share the same idea – on how to debug all the available variables but this time on those machines where you don’t have bash but powershell instead.

Just add to your pipeline PowerShell task, switch to inline script and fill the script

Get-ChildItem -Path Env:\ | Format-List

so it looks like

and after creation of a new release pipeline and execution of this pipeline you should have something like this: