Azure Files
An Azure service that offers file shares in the cloud.
1,293 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am attempting to automate a copy file process using an Azure Runbook.
Here's the code:
]1
What am I doing wrong here?
Hi @Charlotte Watson ,
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.