azureazure-web-app-serviceazure-storageazure-blob-storageazcopy

AzCopy - breaks on location with $ (dollar sign)


Goal is to copy straight into my blob container named "$web".

Problem is, dollar signs seem to break AzCopy's location parsing...

AzCopy.exe /Source:"C:\temp\" /Dest:"https://mystorage.blob.core.windows.net/$web" /DestKey:"..." /SetContentType /V

Invalid location 'https://mystorage.blob.core.windows.net/$web', address could not be parsed.

I don't get to choose the container name. Escaping the $, aka

 \$

didn't work.

How can I workaround this? Insights appreciated. Thanks!


Solution

  • To future readers who may be tempted to use pre-baked VSTS tasks like File Copy (which uses AzCopy under the hood), I recommend considering the Azure CLI task instead, e.g.

    az storage blob upload-batch --account-name myAccountName --source mySource -d $web

    My client wasn't willing to wait for a schedule they didn't control so switching to the CLI path moved our dependency one level upstream & removed having to wait on the VSTS release cadence (looks like ~6 weeks this time).

    Thanks Jerry for posting back, kudos! In my VSTS I see File Copy v2.0 Preview seems to be available and ostensibly fixes this issue. Static website hosting direct from Azure storage is a nice feature and I'm happy Azure offers it.

    (I hope in the future MS may be able to improve cross-org communication so savvy users keen to checkout new feature releases can have a more consistent experience across all the public-facing surface area.)