none
Trouble Writing Blob Storage File in Azure ML Experiment

    Question

  • From @stevenborg via Twitter:

    "Why isn't Python azure-storage pkg available in AzureML? Here's the error (AzureML): 'from azure.storage.blob import BlobService ImportError: No module named azure.storage.blob'

    I'm actually IN an AzureML experiment and want to write a JSON file to blob storage. Anyway to use Azure w/in AML?"

    Thanks,

    @AzureSupport

    Saturday, February 6, 2016 9:48 PM

Answers

  • Thanks, Sudarshan!  The azure.zip download is useful, but I'd already had something like it I built from scratch, and the document you linked to about importing existing modules I had already used as well.  So I had limited hopes.  I downloaded azure.zip and it failed again, with the same  InsecurePlatformWarning message.

    HOWEVER, the gist had the magic!  I was trying to use the secure HTTPS protocol, and the gist shows that you must only use the insecure HTTP protocol.  That makes total sense, since I was getting the InsecurePlatformWarning message.  Woot!  Moving to HTTP made it all better!  

    We've been working on this problem at Stack nbsp;http://stackoverflow.com/questions/35246826/access-azure-blog-storage-from-within-an-azure-ml-experiment

    I'll update it there with your beautiful solution!  

    Sheesh.  HTTP.  I should have tried it. It's normal troubleshooting - remove security and see if works.  I missed it completely. Thank you, thank you, thank you, Sudarshan!  You rock!

    Wednesday, February 10, 2016 9:52 PM
  • Hello Steven,

    Glad that helped, please let us know if you run into other problems. We investigated the issue with HTTPS in the past but unfortunately do not have a workaround for you yet. As soon as we have HTTPS supported, we'll definitely let you know.

    Thank you once again!

    Sudarshan

    Thursday, February 11, 2016 11:24 PM

All replies

  • Can you try uploading Azure-Storage package as described here - https://azure.microsoft.com/en-us/documentation/articles/machine-learning-execute-python-scripts/
    Wednesday, February 10, 2016 5:59 AM
    Owner
  • Hello Jonathan,

    Yes, @stevenborg is correct, we do not have the Azure client SDK bundled in our Python installation. However, I have made it available as a zip file here:

    https://azuremlpackagesupport.blob.core.windows.net/python/azure.zip

    All you need to do is download the zip file, upload it to your AzureML workspace and connect it to the third port of the Execute Python Script module as described here:

    https://azure.microsoft.com/en-us/documentation/articles/machine-learning-execute-python-scripts/#importing-existing-python-script-modules

    For an example of how to write text data to an Azure blob via Execute Python Script, please see the gist here:

    https://gist.github.com/drdarshan/92fff2a12ad9946892df

    Replace the account name, account key, container name, etc. with the correct values and it should work as expected. Please let us know if you run into any errors.

    Thank you, apologies for the inconvenience.

    Sudarshan (AzureML)

    Wednesday, February 10, 2016 8:07 PM
  • Thanks, Sudarshan!  The azure.zip download is useful, but I'd already had something like it I built from scratch, and the document you linked to about importing existing modules I had already used as well.  So I had limited hopes.  I downloaded azure.zip and it failed again, with the same  InsecurePlatformWarning message.

    HOWEVER, the gist had the magic!  I was trying to use the secure HTTPS protocol, and the gist shows that you must only use the insecure HTTP protocol.  That makes total sense, since I was getting the InsecurePlatformWarning message.  Woot!  Moving to HTTP made it all better!  

    We've been working on this problem at Stack nbsp;http://stackoverflow.com/questions/35246826/access-azure-blog-storage-from-within-an-azure-ml-experiment

    I'll update it there with your beautiful solution!  

    Sheesh.  HTTP.  I should have tried it. It's normal troubleshooting - remove security and see if works.  I missed it completely. Thank you, thank you, thank you, Sudarshan!  You rock!

    Wednesday, February 10, 2016 9:52 PM
  • Hello Steven,

    Glad that helped, please let us know if you run into other problems. We investigated the issue with HTTPS in the past but unfortunately do not have a workaround for you yet. As soon as we have HTTPS supported, we'll definitely let you know.

    Thank you once again!

    Sudarshan

    Thursday, February 11, 2016 11:24 PM
  • Dear Sudarshan,

    The link you provided: https://azuremlpackagesupport.blob.core.windows.net/python/azure.zip

    Is no longer available.

    Could you provide an update link to the package?

    I struggle to create a zip package that actually works and do not find any documentation on how to package Python libraries for use in ML Studio.

    Thanks in Advance!

    Flippie

    Monday, January 7, 2019 3:17 PM