Hi, I’m trying to move my Prefect 2 setup to an Az...
# prefect-community
Hi, I’m trying to move my Prefect 2 setup to an Azure serverless setup. The Prefect Agent is deployed in an Azure Container Instance (ACI). Flows are ran with an azure-container-instance-job block as infra. When I run the agent locally the flow properly executes, but I get “*KeyError: “No class found for dispatch key ‘azure-container-instance-job’ in registry for type ‘Block’.“”,* when executing through the container-hosted agent (image prefecthq/prefect:2-python3.9) . Any clues?
Never used Azure, but my bet would be on the
blocks not being registered. The hosted agent must run something that looks like this:
Copy code
prefect block register -m prefect_azure
It's a separate step which is part of the installation: https://prefecthq.github.io/prefect-azure/#installation
👍 1
🙏 1
The problem was that I need to add a pip install prefect-azure in order for the agent to kick off containers. This guide didn’t contain it.https://discourse.prefect.io/t/how-to-run-a-prefect-2-agent-in-an-azure-container-instance/1427
👍 1
Your tip helped me, thanks!
happy to help!