Created
May 18, 2019 05:36
-
-
Save DexterPOSH/39d53803ac62f75d0ca8b9d1434dbc39 to your computer and use it in GitHub Desktop.
getAuthenticationSettings() method def
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
func getAuthenticationSettings() (s settings, err error) { | |
s = settings{ | |
tenantID: os.Getenv("AZURE_TENANT_ID"), | |
clientID: os.Getenv("AZURE_CLIENT_ID"), | |
clientSecret: os.Getenv("AZURE_CLIENT_SECRET"), | |
certificatePath: os.Getenv("AZURE_CERTIFICATE_PATH"), | |
certificatePassword: os.Getenv("AZURE_CERTIFICATE_PASSWORD"), | |
username: os.Getenv("AZURE_USERNAME"), | |
password: os.Getenv("AZURE_PASSWORD"), | |
envName: os.Getenv("AZURE_ENVIRONMENT"), | |
resource: os.Getenv("AZURE_AD_RESOURCE"), | |
} | |
if s.envName == "" { | |
s.environment = azure.PublicCloud | |
} else { | |
s.environment, err = azure.EnvironmentFromName(s.envName) | |
} | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment