Escaping special characters for azcopy command in a .bat file

pmscorca 1,052 Reputation points
2024-02-16T16:01:51.41+00:00

Hi, in order to use the azcopy command to copy a txt file from an Azure VM machine to a blob storage I've followed this sample syntax:
User's image

The SAS signature introduces some special characters to replace for the .bat file in order to run the azcopy command rightly. I've found and replaced the '%' character with '%%', but which are other special characters to substitute? Thanks

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,199 questions
0 comments No comments
{count} votes

Accepted answer
  1. KarishmaTiwari-MSFT 20,777 Reputation points Microsoft Employee Moderator
    2024-02-17T00:45:56.4433333+00:00

    @pmscorca Thanks for posting your query on Microsoft Q&A.

    In batch files that have the .cmd extension, you'll have to escape the % characters that appear in SAS tokens. You can do that by adding an extra % character next to existing % characters in the SAS token string. The resulting character sequence appears as %%. Make sure to add an extra ^ before each & character to create the character sequence ^&.

    Reference: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10#escape-special-characters-in-sas-tokens

    If you have questions, please let me know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    Please don’t forget to Accept Answer and hit Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members for remediation for similar issues.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.