I am copying some files to azure blob storage. I am following Microsoft docs https://docs.microsoft.com/en-us/powershell/module/azure.storage/new-azurestoragecontainersastoken and https://docs.microsoft.com/en-us/powershell/module/azure.storage/new-azurestoragecontext to create a SAS token. I have the code working but I can't figure out how to set a custom path for URL that New-AzureStorageContext generates, because I would like to copy to a particular path and not the container root. Is there some sort of flag or something for New-AzureStorageContext that will allow me to set this?
# Set AzStorageContext
$destinationContext = New-AzureStorageContext -ConnectionString "DefaultEndpointsProtocol=https;AccountName=xxx;AccountKey=xxx;EndpointSuffix=xxx;"
# Generate SAS URI
$containerSASURI = New-AzureStorageContainerSASToken -Context $destinationContext -ExpiryTime(get-date).AddSeconds(3600) -FullUri -Name "xxx" -Permission rw -Protocol HttpsOnly
My issue is that New-AzureStorageContainerSASToken generates a URL the I use for azure copy destination azcopy copy "xxx" $containerSASURI but it copies to the container root and I would like it to copy to a specific directory e.g \test\demo