I am attempting to automate a copy file process using an Azure Runbook.
Here's the code:
What am I doing wrong here?
AFAIK you would have to download the files under file share to $env:temp location and then upload them to S3 bucket from that location.
Below is a sample runbook with the part to download the file under file share to $env:temp location:
$context = New-AzStorageContext -StorageAccountName "<StorageAccountName>" -StorageAccountKey "<StorageAccessKey>" $StorageShare = Get-AzStorageShare -Name "<FileShareName>" –Context $context Get-AzStorageFileContent –Share $StorageShare –Path "<FileName>" -Destination ($Env:temp) Test-Path -Path ($Env:temp+"/Test.csv")
Note that to use cmdlets provided in the above sample runbook approach, you would have to make sure that Az.Storage module is installed in your Azure Automation account.
6 people are following this question.