Skip to content

Commit

Permalink
allow tenant override by env var
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed May 17, 2022
1 parent cfa1a63 commit feaac36
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/azure/client_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ func AcquireTokenClientCertificate(ctx context.Context, tenantID, resource strin
if v := os.Getenv("AZURE_AUTHORITY_HOST"); v != "" {
authorityHost = v
}
if v := os.Getenv("AZURE_TENANT_ID"); v != "" {
tenantID = v
}

// trim the suffix / if exists
resource = strings.TrimSuffix(resource, "/")
Expand Down
3 changes: 3 additions & 0 deletions pkg/azure/client_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func AcquireTokenClientSecret(ctx context.Context, tenantID, resource string) fu
if v := os.Getenv("AZURE_AUTHORITY_HOST"); v != "" {
authorityHost = v
}
if v := os.Getenv("AZURE_TENANT_ID"); v != "" {
tenantID = v
}

// trim the suffix / if exists
resource = strings.TrimSuffix(resource, "/")
Expand Down
3 changes: 3 additions & 0 deletions pkg/azure/client_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func AcquireTokenFederatedToken(ctx context.Context, tenantID string) func(tenan
if v := os.Getenv("AZURE_AUTHORITY_HOST"); v != "" {
authorityHost = v
}
if v := os.Getenv("AZURE_TENANT_ID"); v != "" {
tenantID = v
}

// trim the suffix / if exists
resource = strings.TrimSuffix(resource, "/")
Expand Down

0 comments on commit feaac36

Please sign in to comment.