Created
February 10, 2016 19:58
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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