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.