Created
May 17, 2019 13:58
-
-
Save DexterPOSH/4fab0779bdc0d98b16ef7cc1fa647be6 to your computer and use it in GitHub Desktop.
NewAuthorizerFromEnvironment() method def from github.com/Azure/go-autorest/autorest/azure/auth package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NewAuthorizerFromEnvironment creates an Authorizer configured from environment variables in the order: | |
// 1. Client credentials | |
// 2. Client certificate | |
// 3. Username password | |
// 4. MSI | |
func NewAuthorizerFromEnvironment() (autorest.Authorizer, error) { | |
settings, err := getAuthenticationSettings() | |
if err != nil { | |
return nil, err | |
} | |
if settings.resource == "" { | |
settings.resource = settings.environment.ResourceManagerEndpoint | |
} | |
return settings.getAuthorizer() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment