Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication examples for Azure Blob Storage #2634

Merged
merged 10 commits into from
Jul 28, 2021
41 changes: 39 additions & 2 deletions content/docs/command-reference/remote/modify.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ storage. Whether they're effective depends on each storage platform.
- `account_name` (required) - storage account name

```dvc
$ dvc remote modify myremote account_name 'myuser'
$ dvc remote modify myremote account_name 'myaccount'
```

By default, DVC authenticates using an `account_name` and its
Expand Down Expand Up @@ -406,7 +406,44 @@ application. To use a custom authentication method, use the following parameters
```dvc
$ dvc remote modify myremote allow_anonymous_login true
```
**Authentication examples:**

Authentication example with currently logged in az cli user/identity:

```dvc
$ dvc remote add -d myremote azure://mycontainer/object
$ dvc remote modify myremote account_name 'myaccount'
$ dvc remote push
```
Note: the above example requires at least
`Storage Blob Data Contributor` role on `myaccount`.

Authentication example with `connection_string`:

```dvc
$ dvc remote add -d myremote azure://mycontainer/object
$ dvc remote modify --local myremote connection_string 'mysecret'
$ dvc remote push
```

Authentication example with `account_key`:
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

```dvc
$ dvc remote add -d myremote azure://mycontainer/object
$ dvc remote modify --local myremote account_name 'myaccount'
$ dvc remote modify --local myremote account_key 'mysecret'
$ dvc remote push
```

Authentication example with `sas_token`:

```dvc
$ dvc remote add -d myremote azure://mycontainer/object
$ dvc remote modify --local myremote account_name 'myaccount'
$ dvc remote modify --local myremote sas_token 'mysecret'
$ dvc remote push
```

Note that Azure remotes can also authenticate via environment variables (instead
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
of `dvc remote modify`). These are tried if none of the params above are set.

Expand All @@ -419,7 +456,7 @@ $ export AZURE_STORAGE_CONNECTION_STRING='mysecret'
For account name and key/token auth:

```dvc
$ export AZURE_STORAGE_ACCOUNT='myuser'
$ export AZURE_STORAGE_ACCOUNT='myaccount'
# and
$ export AZURE_STORAGE_KEY='mysecret'
# or
Expand Down