Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EnvironmentCredential and EnvironmentVariables #9430

Closed

Conversation

zzhxiaofeng
Copy link

Add the AZURE_CLIENT_CERTIFICATE_PATH to EnvironmentVariables, and update the EnvironmentCredential to support AZURE_CLIENT_CERTIFICATE_PATH

@@ -59,13 +59,19 @@ internal EnvironmentCredential(CredentialPipeline pipeline)
string username = EnvironmentVariables.Username;
string password = EnvironmentVariables.Password;
string sdkAuthLocation = EnvironmentVariables.SdkAuthLocation;
string clientCertificatePath = EnvironmentVariables.ClientCertificatePath;
var clientCertificate = new X509Certificate2(clientCertificatePath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The X509Certificate2 should only be instantiated in the if block below.

               else if (clientCertificate != null)
                {
                    var clientCertificate = new X509Certificate2(clientCertificatePath);

                    _credential = new ClientCertificateCredential(tenantId, clientId, clientCertificate, _pipeline);
                }

@ellismg
Copy link
Member

ellismg commented Mar 2, 2020

I think this was covered as part of #10196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants