Skip to content

Instantly share code, notes, and snippets.

@drdarshan
Created February 10, 2016 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drdarshan/92fff2a12ad9946892df to your computer and use it in GitHub Desktop.
Save drdarshan/92fff2a12ad9946892df to your computer and use it in GitHub Desktop.
Demonstrates the use of the Azure Python SDK to write files to Azure Storage from AzureML
STORAGE_ACCOUNT="ENTER YOUR STORAGE ACCOUNT NAME HERE"
STORAGE_KEY="ENTER YOUR STORAGE ACCOUNT KEY HERE"
CONTAINER_NAME="ENTER THE CONTAINER NAME WHERE YOU WANT THE OUTPUT BLOB TO GO"
BLOB_NAME="ENTER THE NAME OF THE OUTPUT BLOB HERE"
def azureml_main(dataframe1 = None, dataframe2 = None):
from azure.storage.blob.blobservice import BlobService
dataframe1.to_csv("output.csv", index=False)
client = BlobService(STORAGE_ACCOUNT, \
STORAGE_KEY, \
protocol="http")
client.put_block_blob_from_path(
CONTAINER_NAME,\
BLOB_NAME,\
"output.csv")
return dataframe1,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment