Skip to content

Reading from custom URL or CDN

John Rusk [MSFT] edited this page Jun 21, 2020 · 2 revisions

Normally AzCopy reads from local disk, an Azure Storage Service (e.g. Blob), or S3. But, you can use it to read a single file from any URL. Use a command line like this:

azcopy copy "http://example.com/path/filename" http://account.blob.core.windows.net --from-to BlobBlob

The key here is the from-to parameter, which tells AzCopy the type of location that it is copying from and to. When using a custom URL as a source, you have to specify this parameter because AzCopy won't be able to automatically recognise the source URL. The from-to parameter has two parts, the first word is the type of resource that is being copied from and the second word is the type of resource that is being copied to. When using a custom source, use "Blob" as the first word, to trick AzCopy into thinking its reading from Blob Storage. (This works fine when copying a single file. But there is no concept of copying a whole container when using a custom source).

For the second word, use Blob if your target is blob, File if your target is Azure Files, and Local if your target is local. E.g.

azcopy copy "http://example.com/path/filename" http://account.file.core.windows.net --from-to BlobFile
azcopy copy "http://example.com/path/filename" c:\temp --from-to BlobLocal

This feature is designed to work with source URLs that either require no authentication, or include an authentication token in the URL. I.e. it's not designed for sources that require a separate 'login' step.