Azure sdk for python
http://www.oschina.net/translate/python-windows-azure
Len 6:17:54 PM
__author__ = 'len.li'
from azure.storage import BlobService
AccountName='acdpdeploytest'
AccountKey='BLGXQ/P/6J1fI3xfIWxyShEms/N9TU85sD8gF+l1fju6QUgPaevXEKTOXQ=='
LocalPath = 'd:/log/data/';
AzureStorageDirname='picture'
AzureScrpitdir = 'scripts'
files = ['Test.bat']
def downloadAzureFile(dirname,filename,localfilename):
print('Start Download Azure File '+dirname+'/'+filename)
try:
blob_service = BlobService(AccountName,AccountKey)
blob=blob_service.get_blob_to_path(dirname,filename,LocalPath+localfilename)
if blob is None:
print('End Download Azure File:'+filename+' Download Success!')
except Exception,e:
print('End Download Azure File:'+filename+' Download Failed!--------------------------->'+e.message)
#-----------------------------------------------------
print('----------------------Start Execute downloadAzureFile----------------------->')
for filename in files:
downloadAzureFile(AzureScrpitdir,filename,filename)
print('----------------------End Execute downloadAzureFile------------------------->')
Len 6:27:08 PM
__author__ = 'len.li'
from azure.storage import BlobService
AccountName='acdpdeploytest'
AccountKey='BLGXQ/P/6J1fI3xfIcDWxyShEms/N9TUSG858gF+l1fju6QUgPaevXKaq'
LocalPath = 'data';
AzureStorageDirname='picture'
AzureScrpitdir = 'scripts'
files = ['${script_1}']
def downloadAzureFile(dirname,filename,localfilename):
print('Start Download Azure File '+dirname+'/'+filename)
try:
blob_service = BlobService(AccountName,AccountKey)
blob=blob_service.get_blob_to_path(dirname,filename,LocalPath+localfilename)
if blob is None:
print('End Download Azure File:'+filename+' Download Success!')
except Exception,e:
print('End Download Azure File:'+filename+' Download Failed!--------------------------->'+e.message)
#-----------------------------------------------------
print('----------------------Start Execute downloadAzureFile----------------------->')
for filename in files:
downloadAzureFile(AzureScrpitdir,filename,filename)
print('----------------------End Execute downloadAzureFile------------------------->')
Len 6:29:18 PM
https://github.com/Azure/azure-sdk-for-python