Skip to content

Update disk-encryption-migrate.md#479

Open
rakesh479 wants to merge 1 commit into
MicrosoftDocs:mainfrom
rakesh479:patch-1
Open

Update disk-encryption-migrate.md#479
rakesh479 wants to merge 1 commit into
MicrosoftDocs:mainfrom
rakesh479:patch-1

Conversation

@rakesh479

Copy link
Copy Markdown

Issue: CLI script used while generating new Managed disk in MDE to HBE migration document is not working due to Syntax error in SAS token generation step.
• Issue observed during disk copy using AzCopy where command failed with “wrong number of arguments”
• On initial validation, identified that $sourceSASURI and $targetSASURI variables were empty
• Confirmed by echoing variables and seeing no values populated

targetSASURI=$(az disk grant-access -n $targetDiskName -g $targetRG --access-level Write --duration-in-seconds 86400 --query [accessSas] -o tsv)
rakesh [ ~ ]$ sourceSASURI=$(az disk grant-access -n $sourceDiskName -g $sourceRG --access-level Read --duration-in-seconds 86400 --query [accessSas] -o tsv)
rakesh [ ~ ]$ echo $sourceSASURI
None
rakesh [ ~ ]$ echo $targetSASURI
None

• Root cause identified as case-sensitivity issue in Azure CLI query
• Script was using --query accessSas, while actual field returned by CLI is accessSAS (case-sensitive mismatch) when tried to generate the SAS manually.

az disk grant-access -n $targetDiskName -g $targetRG --access-level Write --duration-in-seconds 86400
{
"accessSAS": "https://md-impexp-xxxxxxxxx.z5.blob.storage.azure.net/qfc0cr0jtq2s/abcd?sv=xxxx-03-28&sr=b&si=a76a778d-42b6-4225-ae51-cee4054a5442&sig=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%3D"
}

• Due to incorrect case, SAS values were not captured into variables, leading to empty inputs for AzCopy
• Notably, PowerShell flow worked as expected, as it handles the response object directly without requiring explicit field name matching
• However, when using Azure CLI (bash script) to create disk and copy data, SAS generation appeared to fail due to incorrect query casing
• Updated query to use --query accessSAS, after which SAS URLs were correctly retrieved

targetSASURI=$(az disk grant-access -n $targetDiskName -g $targetRG --access-level Write --duration-in-seconds 86400 --query [accessSAS] -o tsv)
rakesh [ ~ ]$ sourceSASURI=$(az disk grant-access -n $sourceDiskName -g $sourceRG --access-level Read --duration-in-seconds 86400 --query [accessSAS] -o tsv)
rakesh [ ~ ]$ echo $targetSASURI
https://md-impexp-xxxxxxxxxxxxxxxxxxxxxxjvk.z5.blob.storage.azure.net/qfc0cr0jtq2s/abcd?sv=2018-03-28&sr=b&si=a76a778d-42b6-4225-ae51-cee4054a5442xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0%3D
rakesh [ ~ ]$ echo $sourceSASURI
https://md-hdd-xxxxxxxxxxxxxxx.blob.storage.azure.net/qcs35zbrcl3t/abcd?sv=2018-03-28&sr=b&si=2a8fdd6f-b9ec-48e9-9947-031d07e62xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc%3D

• Post fix, variables were populated successfully and AzCopy command completed without issues

Issue: CLI script used while generating new Managed disk with azcopy in MDE to HBE migration document is not working due to Syntax error in SAS token generation step.

•	Issue observed during disk copy using AzCopy where command failed with “wrong number of arguments”
•	On initial validation, identified that $sourceSASURI and $targetSASURI variables were empty
•	Confirmed by echoing variables and seeing no values populated
•	 
•	Root cause identified as case-sensitivity issue in Azure CLI query
•	Script was using --query accessSas, while actual field returned by CLI is accessSAS (case-sensitive mismatch) when tried to generate the SAS manually.
•	 
•	Due to incorrect case, SAS values were not captured into variables, leading to empty inputs for AzCopy
•	Notably, PowerShell flow worked as expected, as it handles the response object directly without requiring explicit field name matching
•	However, when using Azure CLI (bash script) to create disk and copy data, SAS generation appeared to fail due to incorrect query casing
•	Updated query to use --query accessSAS, after which SAS URLs were correctly retrieved
•	 
•	Post fix, variables were populated successfully and AzCopy command completed without issues
@prmerger-automator

Copy link
Copy Markdown
Contributor

@rakesh479 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit ba6d11b:

✅ Validation status: passed

File Status Preview URL Details
articles/virtual-machines/disk-encryption-migrate.md ✅Succeeded

For more details, please refer to the build report.

@v-regandowner

Copy link
Copy Markdown
Contributor

@msmbaldwin

Can you review the proposed changes?

IMPORTANT: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator Bot added the aq-pr-triaged C+L Pull Request Review Team label label Jun 18, 2026
@rakesh479

Copy link
Copy Markdown
Author

Hello Team,

Do we have an update on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants