Skip to content

Commit

Permalink
Documents usage of DAPR_API_TOKEN (#654)
Browse files Browse the repository at this point in the history
* Documents usage of `DAPR_API_TOKEN`

Signed-off-by: Elena Kolevska <[email protected]>

* Adds link to dapr api token docs

Signed-off-by: Elena Kolevska <[email protected]>

---------

Signed-off-by: Elena Kolevska <[email protected]>
Co-authored-by: Bernd Verst <[email protected]>
  • Loading branch information
elena-kolevska and berndverst authored Jan 9, 2024
1 parent 656207a commit 5c10b78
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions daprdocs/content/en/python-sdk-docs/python-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ with DaprClient() as d:
```

#### Specifying an endpoint on initialisation:
When passed as an argument in the constructor, the gRPC endpoint takes precedence over any configuration or environment variable.
When passed as an argument in the constructor, the gRPC endpoint takes precedence over any
configuration or environment variable.

```python
from dapr.clients import DaprClient
Expand All @@ -48,7 +49,9 @@ with DaprClient("mydomain:50051?tls=true") as d:
# use the client
```

#### Specifying the endpoint in an environment variable:
#### Environment variables:

##### Dapr Sidecar Endpoints
You can use the standardised `DAPR_GRPC_ENDPOINT` environment variable to
specify the gRPC endpoint. When this variable is set, the client can be initialised
without any arguments:
Expand All @@ -66,6 +69,11 @@ with DaprClient() as d:
The legacy environment variables `DAPR_RUNTIME_HOST`, `DAPR_HTTP_PORT` and `DAPR_GRPC_PORT` are
also supported, but `DAPR_GRPC_ENDPOINT` takes precedence.

##### Dapr API Token
If your Dapr instance is configured to require the `DAPR_API_TOKEN` environment variable, you can
set it in the environment and the client will use it automatically.
You can read more about Dapr API token authentication [here](https://docs.dapr.io/operations/security/api-token/).


## Building blocks

Expand Down

0 comments on commit 5c10b78

Please sign in to comment.