none
[Python][Azure Storage] "The specified container does not exist" error on using azure python package RRS feed

  • Question

  • I am trying to communicate with azure blob container from python wrapper for azure , and here is the code I've written

    from azure.storage import BlobService
    blob_service = BlobService(account_name='fo0', account_key='XXXX')
    
    def test():
    	blob_service.put_block_blob_from_path(
    	    'fo0',
    	    'videos',
    	    '/home/saurav/Desktop/sean1.png',
    	    x_ms_blob_content_type='image/png'
    	)
    
    if __name__ == '__main__':
    	test()

    Upon running this code I get the following error, 

    azure.WindowsAzureMissingResourceError: Not found (The specified container does not exist.)

    I've create the container fo0, as a blob container, on the azure portal.

    I've tried googling for this error, but found nothing. Any help in this matter will be greatly appreciated.





    Friday, June 19, 2015 1:18 PM

Answers

  • Hi,

    From the error message, we can know that the container is not exist, it is weird, please try to use the following code above your upload method:

    blob_service.create_container('fo0')

    Please check your code with this article: https://azure.microsoft.com/en-gb/documentation/articles/storage-python-how-to-use-blob-storage/

    In addition, the container name in your code is 'fo0', please ensure your container name in portal is 'fo0' not 'f00' or 'foo'.

    Best Regards,

    Jambor


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, June 22, 2015 12:30 AM
    Moderator

All replies

  • Hi,

      I am trying to involve someone familiar with the topic to look into this. Will post a reply soon.

      Your patience is appreciated.

    Regards,


    Saturday, June 20, 2015 5:32 AM
  • Hi,

    From the error message, we can know that the container is not exist, it is weird, please try to use the following code above your upload method:

    blob_service.create_container('fo0')

    Please check your code with this article: https://azure.microsoft.com/en-gb/documentation/articles/storage-python-how-to-use-blob-storage/

    In addition, the container name in your code is 'fo0', please ensure your container name in portal is 'fo0' not 'f00' or 'foo'.

    Best Regards,

    Jambor


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, June 22, 2015 12:30 AM
    Moderator