Access denied to Azure storage
<p>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. </p>

<p>My code : </p>

<pre><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()
</code></pre>

<p>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 .</p>

<p><strong>EDIT :</strong> </p>

<p><strong>ERROR -</strong> SuspiciousOperation: Attempted access to 'blob url' denied.</p>

<p>Per my experience, the reason for this issue may be that your code does some suspicious access to the on-premises site directory. You could test whether you could get the image URL by  running the following code. If you could see the image URL in the console, that indicates you have the access to your azure storage. If not, please let me know.</p>

<pre class="lang-html prettyprint-override"><code>from azure.storage.blob import BlockBlobService
from azure.storage.blob import PublicAccess 
from azure.storage.blob import ContentSettings

block_blob_service = BlockBlobService(account_name=ACCOUNT_NAME, account_key=ACCOUNT_KEY)
block_blob_service.create_container('newcontainer', public_access=PublicAccess.Container)
block_blob_service.create_blob_from_path(
    'newcontainer',
    'myblockblob',
    'C:\myimages\image.jpg',
    content_settings=ContentSettings(content_type='image/jpg')
            )
image_url = block_blob_service.make_blob_url('newcontainer', "myblockblob")
print(image_url);
</code></pre>

<p> 
 You may could find what the problem is by the following URLs.</p>

<p><a href="http://stackoverflow.com/questions/20747001/django-suspiciousoperation-at-upload-when-uploading-a-file">Django SuspiciousOperation at /upload/ when uploading a file</a></p>

<p><a href="http://stackoverflow.com/questions/18647182/django-suspicious-operation-on-image-upload">django suspicious operation on image upload</a></p>

<p>Hope it helps. Any concerns, please feel free to let me know.</p>

python django azure windows-azure-storage azure-storage-blobs