You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace DefaultAzureCredential with DeveloperToolsCredential (#2873)
DeveloperToolsCredential is effectively the DefaultAzureCredential from
other SDKs, configured for dev mode. It's designed to simplify getting
started with the SDK, for example by copying sample code. It only
supports authenticating via dev tools such as `az` and `azd`, and its
behavior isn't configurable. Developers who want to set additional
options for its constituent types or change their order can instead use
them directly.
Similarly to DefaultAzureCredential, DeveloperToolsCredential requests a
token from each dev tool in turn, stopping when one provides a token.
After receiving a token from some tool, a DeveloperToolsCredential
instance uses that tool exclusively; it never tries the others again.
There are a couple big reasons for removing DefaultAzureCredential
instead of implementing it as in other SDKs:
- **Default**AzureCredential implies it's always a good choice, if not
the only choice, when in fact it's typically better to use a more
specific type
- trying a sequence of credentials introduces uncertainty and can be
dangerous (see #2283 and [guidance for other
SDKs](https://aka.ms/azsdk/net/identity/credential-chains#usage-guidance-for-defaultazurecredential))
---------
Co-authored-by: Heath Stewart <[email protected]>
@@ -398,13 +398,13 @@ There can only be one async runtime set in a given process, so attempts to set t
398
398
To help protected end users from accidental Personally-Identifiable Information (PII) from leaking into logs or traces, models' default implementation of `core::fmt::Debug` formats as non-exhaustive structure tuple e.g.,
@@ -44,7 +44,7 @@ let options = ServiceClientOptions {
44
44
If it is more convenient to use the global OpenTelemetry provider, then the `OpenTelemetryTracerProvider::new_from_global_provider` method will configure the OpenTelemetry support to use the global provider instead of a custom configured provider.
Copy file name to clipboardExpand all lines: sdk/cosmos/azure_data_cosmos/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,22 +46,22 @@ In order to interact with the Azure Cosmos DB service, you'll need to create an
46
46
47
47
**Using Microsoft Entra ID**
48
48
49
-
The example shown below use a `DefaultAzureCredential`, which is appropriate for most local development environments. Additionally, we recommend using a managed identity for authentication in production environments. You can find more information on different ways of authenticating and their corresponding credential types in the [Azure Identity] documentation.
49
+
The example shown below use a `DeveloperToolsCredential`, which is appropriate for most local development environments. Additionally, we recommend using a managed identity for authentication in production environments. You can find more information on different ways of authenticating and their corresponding credential types in the [Azure Identity] documentation.
50
50
51
-
The `DefaultAzureCredential` will automatically pick up on an Azure CLI authentication. Ensure you are logged in with the Azure CLI:
51
+
The `DeveloperToolsCredential` will automatically pick up on an Azure CLI authentication. Ensure you are logged in with the Azure CLI:
52
52
53
53
```sh
54
54
az login
55
55
```
56
56
57
-
Instantiate a `DefaultAzureCredential` to pass to the client. The same instance of a token credential can be used with multiple clients if they will be authenticating with the same identity.
57
+
Instantiate a `DeveloperToolsCredential` to pass to the client. The same instance of a token credential can be used with multiple clients if they will be authenticating with the same identity.
Copy file name to clipboardExpand all lines: sdk/eventhubs/azure_messaging_eventhubs/README.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,20 +52,20 @@ cargo add azure_identity tokio
52
52
53
53
In order to interact with the Azure Event Hubs service, you'll need to create an instance of the `ProducerClient` or the `ConsumerClient`. You need an **event hub namespace host URL** (which you may see as `serviceBusEndpoint` in the Azure CLI response when creating the Even Hubs Namespace), an **Event Hub name** (which you may see as `name` in the Azure CLI response when crating the Event Hub instance), and credentials to instantiate a client object.
54
54
55
-
The example shown below uses a [`DefaultAzureCredential`][default_cred_ref], which is appropriate for most local development environments. Additionally, we recommend using a managed identity for authentication in production environments. You can find more information on different ways of authenticating and their corresponding credential types in the [Azure Identity] documentation.
55
+
The example shown below uses a `DeveloperToolsCredential`, which is appropriate for most local development environments. Additionally, we recommend using a managed identity for authentication in production environments. You can find more information on different ways of authenticating and their corresponding credential types in the [Azure Identity] documentation.
56
56
57
-
The `DefaultAzureCredential` will automatically pick up on an Azure CLI authentication. Ensure you are logged in with the Azure CLI:
57
+
The `DeveloperToolsCredential` will automatically pick up on an Azure CLI authentication. Ensure you are logged in with the Azure CLI:
58
58
59
59
```azurecli
60
60
az login
61
61
```
62
62
63
-
Instantiate a `DefaultAzureCredential` to pass to the client. The same instance of a token credential can be used with multiple clients if they will be authenticating with the same identity.
63
+
Instantiate a `DeveloperToolsCredential` to pass to the client. The same instance of a token credential can be used with multiple clients if they will be authenticating with the same identity.
64
64
65
65
### Create an Event Hubs message producer and send an event
0 commit comments