Skip to content

Instantly share code, notes, and snippets.

@bcnzer
Created November 13, 2017 09:22
Show Gist options
  • Select an option

  • Save bcnzer/3d62fb37a094dd454b7da21af94877a3 to your computer and use it in GitHub Desktop.

Select an option

Save bcnzer/3d62fb37a094dd454b7da21af94877a3 to your computer and use it in GitHub Desktop.
Upload resultant files to Azure blog storage
# Azure subscription-specific variables.
$storageAccountName = "spotterazurelogs"
$containerName = "robotframework-logs"
# Upload files in data subfolder to Azure.
$localfolder = "$(OutputFolder)"
$destfolder = "$(Release.ReleaseName)"
$blobContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $(SpotterLogStorageKey)
$files = Get-ChildItem $localFolder
foreach($file in $files)
{
$fileName = "$localFolder\$file"
$blobName = "$(Release.ReleaseName)/$file"
write-host "copying $fileName to $blobName"
Set-AzureStorageBlobContent -File $filename -Container $containerName -Blob $blobName -Context $blobContext -Force
}
write-host "All files in $localFolder uploaded to $containerName!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment