How can I "dvc get" using a non-default remote storage?


I am in a situation where I have two remote storages, both up-to-date. The .dvc/config fil looks like this (my machine only has access to dev_remote):

    remote = prod_remote
['remote "dev_remote"']
    url = azure://xyz
    account_name = my_dev_account_name
    allow_anonymous_login = false
['remote "prod_remote"']
    url = azure://abc
    account_name = my_prod_account_name
    allow_anonymous_login = false

I now run

dvc get "url_to_my_remote_repo" "file_path" --remote "dev_remote" --rev "a_rev"

This throws an error:

ERROR: unexpected error - Operation returned an invalid status 'This request is not authorized to perform this operation using this permission.'  

If I run:
dvc get --show-url "url_to_my_remote_repo" "file_path" --remote "dev_remote" --rev "a_rev"
I get the URL to the file on prod_remote.

What am I doing wrong and why does dvc ignore the remote argument?

There looks to be a bug with --show-url where it ignores the remote argument. However, the error you get in the first command without --show-url looks to be a permissions issue, and dvc is not ignoring the remote argument in that case. From the error, it looks like this is an issue with your azure configuration where you are not authorized to download from that remote. Please try to make sure you can access those files using az cli and the same permissions.

Thank you for your help. I can download the same blob via az storage blob download without a problem.

Are there any other suggestions on how to debug this? I ran dvc get with the --verbose option to see if it would display, what it is trying to access, but I can’t see anything from it.