fastapi-azure-function-apim icon indicating copy to clipboard operation
fastapi-azure-function-apim copied to clipboard

Error with `azd up` on m1 mac in devcontainer

Open prodgers1 opened this issue 2 years ago • 3 comments
trafficstars

Hello,

I am seeing an error when attempting to deploy to azure using the azd up command that is outlined in the README. I am on an m1 mac using a devcontainer within VS code. I am able to run the function locally, but seeing the following error during the deployment:

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: 
creating template: failed to compile bicep template: failed running bicep build: signal: aborted, stdout: , 
stderr: Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Text.RegularExpressions.Regex.CreateRunner()

When looking for others that may have encountered the same issue, I found this other github issue on a separate repo that claims to have a workaround. When I use this suggested fix, I encounter further errors with not being able to find required packages defined in this repo (Azure Function Tools is a common one that I encounter that says it "cannot be found").

I'm curious to know if there is any workaround that you've found that has worked for deploying this on a m1 mac using devcontainers?

Thanks in advance!

prodgers1 avatar Oct 23 '23 21:10 prodgers1

I believe this error is expected, sadly, as the Dockerfile is still using amd64 emulation mode (qemu) in order to bring azure-functions-core-tools. We're still waiting for ARM64 support for Python azure-functions-core-tools, which should be any day now: https://github.com/Azure/azure-functions-python-worker/issues/915

I've also checked with the azd team to see if they have other workarounds, as this affects other samples with Azure Functions.

For now, I deploy outside the container or in Codespaces.

pamelafox avatar Oct 31 '23 19:10 pamelafox

I also encountered this issue using a devcontainer on Mac silicon. I see the referenced issue is now closed. Is there an easy fix?

covolution avatar Jan 09 '24 10:01 covolution

Sorry, I still haven't figured out a devcontainer setup that will work on an M1. I've been running it in either Codespaces or locally. I've asked the Functions and azd teams to look into it, however.

pamelafox avatar Nov 07 '24 21:11 pamelafox