Hello Stryletskiy Andrew ,
I understand that you have a python app that is already access to the azure vnet and can access to the storage account by service endpoint but there is a problem getting blob when is loading your application on browser.
In that case when you’re accessing the blob to load and show in your app, the request to get the blob is coming from the client’s browser (the web), not directly from your application. This is because the image URL is being sent to the client’s browser, and the browser is making the GetBlob
request to load the image.
On the other hand, the ListBlobs
operation is performed by your application on the server-side. This operation is used to retrieve a list of all the blobs in the container, and this request is made directly from your application, not from the client’s browser.
This is why the GetBlob
request is failing with an AnonymousIpAuthorizationError
. The request is coming from an IP address that is not within the range of your vNet, hence it’s not authorized by the vNet firewall.
To solve this you might consider using a SAS token (Shared Access Signature) to delegate access to the blob resource. You can create a SAS token from your application, and append it to the blob URL before sending it to the client’s browser. This way, the GetBlob
request from the client’s browser will be authorized.
References:
- https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview
- https://learn.microsoft.com/en-us/azure/storage/common/authorize-data-access?tabs=blobs
If the information helped address your question, please Accept the answer.
Luis