Skip to content

Commit 34f6985

Browse files
authored
[Identity] Class documentation improvements (Azure#32043)
This adds additional details to the docstrings for some of the credential classes. Users may find the added info helpful. Also added missing envvar in README. Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
1 parent 8cecf21 commit 34f6985

File tree

4 files changed

+37
-7
lines changed

4 files changed

+37
-7
lines changed

sdk/identity/Azure.Identity/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ Not all credentials require this configuration. Credentials which authenticate t
232232
|Variable name|Value
233233
|-|-
234234
|`AZURE_CLIENT_ID`|ID of an Azure AD application
235+
|`AZURE_TENANT_ID`|ID of the application's Azure AD tenant
235236
|`AZURE_USERNAME`|a username (usually an email address)
236237
|`AZURE_PASSWORD`|that user's password
237238

sdk/identity/Azure.Identity/src/Credentials/EnvironmentCredential.cs

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,39 @@
1313
namespace Azure.Identity
1414
{
1515
/// <summary>
16-
/// Enables authentication to Azure Active Directory using client secret, or username and password,
17-
/// details configured in the following environment variables:
16+
/// Enables authentication to Azure Active Directory using a client secret or certificate, or as a user
17+
/// with a username and password.
18+
/// <para>
19+
/// Configuration is attempted in this order, using these environment variables:
20+
/// </para>
21+
///
22+
/// <b>Service principal with secret:</b>
1823
/// <list type="table">
1924
/// <listheader><term>Variable</term><description>Description</description></listheader>
20-
/// <item><term>AZURE_TENANT_ID</term><description>The Azure Active Directory tenant(directory) ID.</description></item>
21-
/// <item><term>AZURE_CLIENT_ID</term><description>The client(application) ID of an App Registration in the tenant.</description></item>
25+
/// <item><term>AZURE_TENANT_ID</term><description>The Azure Active Directory tenant (directory) ID.</description></item>
26+
/// <item><term>AZURE_CLIENT_ID</term><description>The client (application) ID of an App Registration in the tenant.</description></item>
2227
/// <item><term>AZURE_CLIENT_SECRET</term><description>A client secret that was generated for the App Registration.</description></item>
28+
/// </list>
29+
///
30+
/// <b>Service principal with certificate:</b>
31+
/// <list type="table">
32+
/// <listheader><term>Variable</term><description>Description</description></listheader>
33+
/// <item><term>AZURE_TENANT_ID</term><description>The Azure Active Directory tenant (directory) ID.</description></item>
34+
/// <item><term>AZURE_CLIENT_ID</term><description>The client (application) ID of an App Registration in the tenant.</description></item>
2335
/// <item><term>AZURE_CLIENT_CERTIFICATE_PATH</term><description>A path to certificate and private key pair in PEM or PFX format, which can authenticate the App Registration.</description></item>
24-
/// <item><term>AZURE_CLIENT_SEND_CERTIFICATE_CHAIN</term><description>Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to `true` or `1`, authentication requests include the x5c header.</description></item>
36+
/// <item><term>AZURE_CLIENT_CERTIFICATE_PASSWORD</term><description>(Optional) The password protecting the certificate file (currently only supported for PFX (PKCS12) certificates).</description></item>
37+
/// <item><term>AZURE_CLIENT_SEND_CERTIFICATE_CHAIN</term><description>(Optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to `true` or `1`, authentication requests include the x5c header.</description></item>
38+
/// </list>
39+
///
40+
/// <b>Username and password:</b>
41+
/// <list type="table">
42+
/// <listheader><term>Variable</term><description>Description</description></listheader>
43+
/// <item><term>AZURE_TENANT_ID</term><description>The Azure Active Directory tenant (directory) ID.</description></item>
44+
/// <item><term>AZURE_CLIENT_ID</term><description>The client (application) ID of an App Registration in the tenant.</description></item>
2545
/// <item><term>AZURE_USERNAME</term><description>The username, also known as upn, of an Azure Active Directory user account.</description></item>
2646
/// <item><term>AZURE_PASSWORD</term><description>The password of the Azure Active Directory user account. Note this does not support accounts with MFA enabled.</description></item>
2747
/// </list>
48+
///
2849
/// This credential ultimately uses a <see cref="ClientSecretCredential"/>, <see cref="ClientCertificateCredential"/>, or <see cref="UsernamePasswordCredential"/> to
2950
/// perform the authentication using these details. Please consult the
3051
/// documentation of that class for more details.

sdk/identity/Azure.Identity/src/Credentials/VisualStudioCodeCredential.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
namespace Azure.Identity
1616
{
1717
/// <summary>
18-
/// Enables authentication to Azure Active Directory using data from Visual Studio Code.
18+
/// Enables authentication to Azure Active Directory as the user signed in to Visual Studio Code via
19+
/// the 'Azure Account' extension.
20+
///
21+
/// It's a <see href="https://github.com/Azure/azure-sdk-for-net/issues/27263">known issue</see> that `VisualStudioCodeCredential`
22+
/// doesn't work with <see href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account">Azure Account extension</see>
23+
/// versions newer than <b>0.9.11</b>. A long-term fix to this problem is in progress. In the meantime, consider authenticating
24+
/// with <see cref="AzureCliCredential"/>.
1925
/// </summary>
2026
public class VisualStudioCodeCredential : TokenCredential
2127
{

sdk/identity/Azure.Identity/src/Credentials/VisualStudioCredential.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
namespace Azure.Identity
1919
{
2020
/// <summary>
21-
/// Enables authentication to Azure Active Directory using data from Visual Studio
21+
/// Enables authentication to Azure Active Directory using data from Visual Studio 2017 or later. See
22+
/// <seealso href="https://learn.microsoft.com/dotnet/azure/configure-visual-studio" /> for more information
23+
/// on how to configure Visual Studio for Azure development.
2224
/// </summary>
2325
public class VisualStudioCredential : TokenCredential
2426
{

0 commit comments

Comments
 (0)