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

Add support for file based authorizer for Azure #10876

Merged
merged 1 commit into from Apr 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions pkg/azure/api/api.go
Expand Up @@ -70,10 +70,13 @@ func NewClient(subscriptionID, resourceGroup string, metrics MetricsAPI, rateLim
limiter: helpers.NewApiLimiter(metrics, rateLimit, burst),
}

// Authorizer based on environment variables
authorizer, err := auth.NewAuthorizerFromEnvironment()
// Authorizer based on file first and then environment variables
authorizer, err := auth.NewAuthorizerFromFile(compute.DefaultBaseURI)
if err != nil {
return nil, err
authorizer, err = auth.NewAuthorizerFromEnvironment()
if err != nil {
return nil, err
}
}

c.interfaces.Authorizer = authorizer
Expand Down