Skip to content

Commit 980f59e

Browse files
authored
[Identity] Documentation improvements (Azure#31798)
Added a disclaimer to the VisualStudioCodeCredential class docstring to highlight its shortcomings. Also slightly updated the EnvironmentCredential class docstring to include a missing envvar. Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com> Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
1 parent 1019336 commit 980f59e

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

sdk/identity/azure-identity/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ While the `DefaultAzureCredential` is generally the quickest way to get started
242242
243243
ManagedIdentityCredential managedIdentityCredential = new ManagedIdentityCredentialBuilder().build();
244244
AzureCliCredential cliCredential = new AzureCliCredentialBuilder().build();
245-
245+
246246
ChainedTokenCredential credential = new ChainedTokenCredentialBuilder().addLast(managedIdentityCredential).addLast(cliCredential).build();
247247

248248
// Azure SDK client builders accept the credential as a parameter
@@ -476,7 +476,7 @@ Credentials can be chained together to be tried in turn until one succeeds using
476476
</tr>
477477
<tr>
478478
<td><code>AZURE_CLIENT_CERTIFICATE_PATH</code></td>
479-
<td>path to a PEM-encoded certificate file including private key</td>
479+
<td>path to a PFX or PEM-encoded certificate file including private key</td>
480480
</tr>
481481
<tr>
482482
<td><code>AZURE_CLIENT_CERTIFICATE_PASSWORD</code></td>
@@ -500,6 +500,10 @@ Credentials can be chained together to be tried in turn until one succeeds using
500500
<td><code>AZURE_CLIENT_ID</code></td>
501501
<td>ID of an Azure AD application</td>
502502
</tr>
503+
<tr>
504+
<td><code>AZURE_TENANT_ID</code></td>
505+
<td>(optional) ID of the application's Azure AD tenant</td>
506+
</tr>
503507
<tr>
504508
<td><code>AZURE_USERNAME</code></td>
505509
<td>a username (usually an email address)</td>

sdk/identity/azure-identity/src/main/java/com/azure/identity/EnvironmentCredential.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* <li>{@link Configuration#PROPERTY_AZURE_CLIENT_ID AZURE_CLIENT_ID}</li>
3737
* <li>{@link Configuration#PROPERTY_AZURE_USERNAME AZURE_USERNAME}</li>
3838
* <li>{@link Configuration#PROPERTY_AZURE_PASSWORD AZURE_PASSWORD}</li>
39+
* <li>{@link Configuration#PROPERTY_AZURE_TENANT_ID AZURE_TENANT_ID}</li>
3940
* </ul>
4041
*/
4142
@Immutable

sdk/identity/azure-identity/src/main/java/com/azure/identity/VisualStudioCodeCredential.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@
2121
import java.util.concurrent.atomic.AtomicReference;
2222

2323
/**
24-
* Enables authentication to Azure Active Directory using data from Visual Studio Code
24+
* Enables authentication to Azure Active Directory as the user signed in to Visual Studio Code via
25+
* the 'Azure Account' extension.
26+
*
27+
* <p>It's a <a href="https://github.com/Azure/azure-sdk-for-java/issues/27364">known issue</a> that this credential doesn't
28+
* work with <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account">Azure Account extension</a>
29+
* versions newer than <strong>0.9.11</strong>. A long-term fix to this problem is in progress. In the meantime, consider
30+
* authenticating with {@link AzureCliCredential}.</p>
2531
*/
2632
public class VisualStudioCodeCredential implements TokenCredential {
2733
private final IdentityClient identityClient;

0 commit comments

Comments
 (0)