help - i'm trying to flip over to prefect2, and no...
# prefect-azure
m
help - i'm trying to flip over to prefect2, and not a prefect expert (coming from a jenkins background), and struggling to follow even the simple example online - https://docs.prefect.io/2.10.13/guides/deployment/aci/ . I have ACIs created. Workpool looks ok. I copy/pasted the code. I'm stuck on the
prefect deployment build
(dropping the --infra flag, too many options to keep track of here).
it seems like the
block
, which is an azure blobstore.. i'm still struggling to understand what the block is for, or what it's equivalent is in jenkins... getting errors like this:
Copy code
File "/Users/some-user/dev/workflows/.venv/lib/python3.9/site-packages/azure/storage/blob/aio/_blob_client_async.py", line 413, in upload_blob
    return await upload_block_blob(**options)
  File "/Users/some-user/dev/workflows/.venv/lib/python3.9/site-packages/azure/storage/blob/aio/_upload_helpers.py", line 173, in upload_block_blob
    process_storage_error(error)
  File "/Users/some-user/dev/workflows/.venv/lib/python3.9/site-packages/azure/storage/blob/_shared/response_handlers.py", line 189, in process_storage_error
    exec("raise error from None")   # pylint: disable=exec-used # nosec
  File "<string>", line 1, in <module>
azure.core.exceptions.HttpResponseError: This request is not authorized to perform this operation.
RequestId:8caeec69-001e-0013-329f-9d4aaa000000
Time:2023-06-13T02:31:02.4582816Z
ErrorCode:AuthorizationFailure
Content: <?xml version="1.0" encoding="utf-8"?><Error><Code>AuthorizationFailure</Code><Message>This request is not authorized to perform this operation.
RequestId:8caeec69-001e-0013-329f-9d4aaa000000
Time:2023-06-13T02:31:02.4582816Z</Message></Error>
An exception occurred.
my user has full access to this azure blobstore.. not sure what/who is failing to upload.. ?
is there a debug flag to get more info?
😐
r
Hi Matt! The deployment command is trying to upload your flow code to an Azure storage blob so your agent/worker will be able to pull the code and run it when it needs to run your flow. You don't have to use an Azure blob. You can also keep your code on GitHub or bake it into a Docker image. In this case, it looks like the credentials in your Azure block are missing or incorrect. I believe the ones you'll need for this to work are: • Storage account name • Storage account key • Storage account connection string (see 1st screenshot). You can leave the other fields blank. You can find all three of these values in the Azure Portal if you load your storage account's page and find 'Access Keys' in the menu on the left (see 2nd screenshot). If you have any questions about what's going on or what to do next, please feel free to ask and I will reply ASAP.
m
ok awesome, i will check that. is there a way to store the code in bitbucket? Docker image is ok too, but bitbucket is probably easier.
r
Yes - you can install this package: https://github.com/PrefectHQ/prefect-bitbucket If you follow the setup instructions, the block should show up in your Prefect UI. Note that you'll also need to install the package on any worker/agent machines that need to pull and run the code.
m
ok awesome, i'll try that. trying to get a single flow working, so we can use it as an example.
šŸ‘€ 1
running on ACI or AKS.
r
ACI is easier, but the AKS is nice if you prefer Kubernetes. I wrote a tutorial about getting flows running on ACI back when I worked for Prefect: https://medium.com/the-prefect-blog/serverless-prefect-flows-with-azure-container-instances-f2442ebc9343 I'm happy to answer questions if you go the ACI route and run into any issues.
šŸ‘ 1
m
thank you, let me try.
šŸ‘ 1
h
Possibly a little self-promoting but maybe this helps: https://github.com/radbrt/prefect_aci
šŸ‘€ 1
šŸ‘ 1