Hi,
Figured it out
while creating the snapshot url, I was passing snapshot as query param, instead we have to pass sharesnapshot, and it will work.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi all,
I am trying to copy my file share from one storage account to another for DR use case by running following commands:
## 1. Generate Account Key for src
source_storage_key =$(az storage account keys list -g <rg> -n <src-storage> --query "[0].value" -o tsv)
## 2. Create snapshot with timestamp of Source File share for PITR
SNAPSHOT_TIMESTAMP=$(az storage share snapshot \
--account-name <acc_name>\
--account-key $source_storage_key \
--name <file_share> \
--query snapshot -o tsv)
## 3. Generate SAS for snapshot
SRC_SAS=$(az storage share generate-sas \
--account-name <acc_name> \
--account-key $source_storage_key \
--name <file_share> \
--permissions rl \
--expiry $(date -u -d "1 day" '+%Y-%m-%dT%H:%MZ') \
--https-only \
-o tsv)
# 4. Get destination storage account key & generate SAS
dest_key=$(az storage account keys list -g <dest-rg> -n <dest-storage> --query "[0].value" -o tsv)
dest_sas=$(az storage share generate-sas -n <dest-share> --account-name <dest-storage> --account-key "$dest_key" --permissions rwl --expiry $(date -u -d "+1 day" '+%Y-%m-%dT%H:%MZ') -o tsv)
# 5. Construct URLs
source_snapshot_url="https://<src-storage>.file.core.windows.net/<src-share>?snapshot=${SNAPSHOT_TIMESTAMP}&${SRC_SAS}"
dest_url="https://<dest-storage>.file.core.windows.net/<dest-share>?$dest_sas"
# 6. AzCopy copy
azcopy copy "$source_snapshot_url" "$dest_url" --recursive --preserve-smb-info --preserve-smb-permissions
Now, if I run azcopy copy with just --recursive flag, my copy is working fine.
But, when I passed these smb flags --preserve-smb-* I started seeing issues.
Getting following error:
Response Details: <Code>InvalidQueryParameterValue</Code><Message>Value for one of the query parameters specified in the request URI is invalid. </Message><QueryParameterName>snapshot</QueryParameterName><QueryParameterValue>2025-07-03T00:03:42.0000000Z</QueryParameterValue><Reason>This operation is only allowed on the root blob. Snapshot should not be provided.</Reason>
Any help on this is would be great.
Thanks
Hi,
Figured it out
while creating the snapshot url, I was passing snapshot as query param, instead we have to pass sharesnapshot, and it will work.