Update disk-encryption-migrate.md#479
Open
rakesh479 wants to merge 1 commit into
Open
Conversation
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
Contributor
|
@rakesh479 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
Contributor
|
Learn Build status updates of commit ba6d11b: ✅ Validation status: passed
For more details, please refer to the build report. |
Contributor
|
Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
Author
|
Hello Team, Do we have an update on this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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