Created
May 20, 2015 21:53
-
-
Save rprakashg/0bdf31c634ab9f1e8967 to your computer and use it in GitHub Desktop.
Upload file to Azure Blob Storage
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
param( | |
[string] $Source, | |
[string] $FileToUpload, | |
[string] $StorageAccountName, | |
[string] $StorageContainerName, | |
[string] $AzCopyPath | |
) | |
$StorageAccountKey = (Get-AzureStorageKey -StorageAccountName $StorageAccountName).Primary | |
$StorageAccountContext = New-AzureStorageContext $StorageAccountName (Get-AzureStorageKey $StorageAccountName).Primary | |
$Dest = $StorageAccountContext.BlobEndPoint + $StorageContainerName | |
#use AzCopy to copy files into blob | |
& "$AzCopyPath" ""$Source"" ""$Dest"" ""$FileToUpload"" /DestKey:""$StorageAccountKey"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment