From 5c10b7815708e6a98e9bf87df9652bda9be5132b Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Tue, 9 Jan 2024 20:31:55 +0000 Subject: [PATCH] Documents usage of `DAPR_API_TOKEN` (#654) * Documents usage of `DAPR_API_TOKEN` Signed-off-by: Elena Kolevska * Adds link to dapr api token docs Signed-off-by: Elena Kolevska --------- Signed-off-by: Elena Kolevska Co-authored-by: Bernd Verst --- daprdocs/content/en/python-sdk-docs/python-client.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/python-sdk-docs/python-client.md b/daprdocs/content/en/python-sdk-docs/python-client.md index 73a1cf703..55c8d14c4 100644 --- a/daprdocs/content/en/python-sdk-docs/python-client.md +++ b/daprdocs/content/en/python-sdk-docs/python-client.md @@ -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 @@ -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: @@ -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