I am storing images on Azure storage. BUt after storing images when I am trying to access bob url it is giving me access denied error.
My code :
block_blob_service = BlockBlobService(account_name=ACCOUNT_NAME, account_key=ACCOUNT_KEY)
block_blob_service.create_container('organisation', public_access=PublicAccess.Container)
org = Organisation.objects.get(pk=34)
image = download_image(org.org_logo.url)
bob = block_blob_service.create_blob_from_path(
'organisation',
org.name,
image,
content_settings=ContentSettings(content_type='image/png')
)
image_url = block_blob_service.make_blob_url('organisation', org.name) **# same url is accessible via browser but not from script**
org.org_logo = image_url **# this is giving error of access denied**
org.save()
I am not sure but I think need to edit CORS settings of my storage , but I am not able to figure out where to edit them from azure portal. If there is something else wrong then also please let me know .
EDIT :
ERROR - SuspiciousOperation: Attempted access to 'blob url' denied.