Skip to content

Commit

Permalink
f/azurecli-auth: making the error message more helpful
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Jul 15, 2019
1 parent 0c83f2e commit 9393cd0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion authentication/auth_method_azure_cli_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ func (a azureCliTokenAuth) build(b Builder) (authMethod, error) {
// Authenticating as a Service Principal doesn't return all of the information we need for authentication purposes
// as such Service Principal authentication is supported using the specific auth method
if authenticatedAsAUser := auth.profile.verifyAuthenticatedAsAUser(); !authenticatedAsAUser {
return nil, fmt.Errorf("Authenticating using the Azure CLI is only supported as a User (not a Service Principal)")
return nil, fmt.Errorf(`Authenticating using the Azure CLI is only supported as a User (not a Service Principal).
To authenticate to Azure using a Service Principal, you can use the separate 'Authenticate using a Service Principal'
auth method - instructions for which can be found in the documentation.
Alternatively you can authenticate using the Azure CLI by using a User Account.`)
}

err = auth.profile.populateFields()
Expand Down

0 comments on commit 9393cd0

Please sign in to comment.