Blocks in Azure Blob Storage have their own unique access URLs. The URL is in the format: http://<your_storage_name>.blob.core.windows.net/<container_name>/<blob_name> , you can directly access it in the browser if you set access to the blob permission for the public.
To your problem, if it is not sensitive to your images in the Blob repository, you can simply set the access permission to public blob to allow access to the public access to the blocks in the container, but not the container properties and metadata.
Log in to the Azure mange portal , click the vault tab in the left navigator, click the name of your vault in the list to go to the vault management page, click the CONTAINERS tab, select a specific container name, click the EDIT button at the bottom, change the access permission and click "OK" to save the configuration:

Click the name of the container that we can put in the list of blocks in this container. We can copy the URL of the item, visit in the browser to check.
And for my understanding, if you want to display images after uploading to Azure storage, we just need to make a few changes to the source code.
In a custom storage class, suppose the url() function should return the correct URL. In my test, I immediately return the URL string for a quick test:
def geturl(self,name): return '%s/%s/%s' % ('http://garyteststorage.blob.core.windows.net','mycontainer', name)
And we can change the return of the _save() function to the image class URL instead of name :
url = self.geturl(name) return url
In models.py :
def upload_path(instance, filename): return 'uploads-from-custom-storage-{}'.format(filename) class Photo(models.Model):
As before, it will save the image name in the database and after modifying it will save the full blob URL in the database.
code snippet In view.py :
if form.is_valid(): newImage = Photo(image_file = request.FILES['image_file']) newImage.save() imageurl = newImage.image_file html = "<img src=%s></img><br>" %imageurl