Event Subscription Storage Blob create/delete not triggered via azure cli, azcopy or python SDK

Ayriss, Barnaby (The Bridge) 0 Reputation points
2024-10-31T17:37:58.8766667+00:00

I've set up a Service Bus queue and an Event Subscription to monitor a directory in my Blob storage, to log the event in the service bus queue, whenever a blob is created, or deleted. This system works as intended when I manually upload files using the web browser portal. However the event subscription does not trigger when I upload or delete files using the Azure cli, AzCopy cli, or the Python SDK functions.

Is this functionality intended? and if so how can I have my event subscription detect files being uploaded though these methods? otherwise can you inform me of other programatic way of uploading files that will trigger the event subscriber to put the event in my service bus queue?

I have also tired using the REST api to PUT files on the blob store but could not get this to work with our storage account repeatedly getting "PublicAccessNotPermitted" error codes, even when using various company proxies and SAS tokens, so I do not believe this avenue will work for my use case.

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
632 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,916 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
390 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 11,991 Reputation points
    2024-10-31T19:44:30.82+00:00

    Hello Ayriss, Barnaby (The Bridge),

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are having issues with the event subscription does not trigger when I upload or delete files using the Azure cli, AzCopy cli, or the Python SDK functions, except when you uploaded manually.

    This is an unexpected behavior with your event subscription, and you forgot to share your code, error or logs with your question.

    However, the possible causes of these issues could be due to your Subscription Configuration, check if your Event Grid subscription is correctly configured to listen to all blob events, not just those triggered by the portal. Also, your permissions level, you will need the identity used by the CLI, AzCopy, or SDK to have the necessary permissions to trigger events. Because different authentication methods might have different permissions.

    About programmatic uploads that trigger Event Subscriptions, you have used all methods, but yet to affirm your code and detail error logs.

    About REST API and “PublicAccessNotPermitted” Error, you do not need to give up. The “PublicAccessNotPermitted” error typically indicates that the storage account or container does not allow public access. You can resolve them by:

    • Make sure the container’s access level is set to allow the required operations. az storage container set-permission --name <container_name> --public-access blob
    • Generate a SAS token with the necessary permissions and use it in your REST API calls. az storage container generate-sas --name <container_name> --permissions rwdl --expiry <expiry_date>
    • Make sure your network and proxy settings allow the necessary traffic to Azure Blob Storage.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.