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

Adding managed-identity support for Azure #1330

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions packages/azure/src/application/AzureAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ClientCertificateCredential,
ClientSecretCredential,
WorkloadIdentityCredential,
DefaultAzureCredential,
} from '@azure/identity'
import { ConsumptionManagementClient } from '@azure/arm-consumption'
import { AdvisorManagementClient } from '@azure/arm-advisor'
Expand Down Expand Up @@ -43,6 +44,7 @@ export default class AzureAccount extends CloudProviderAccount {
| ClientCertificateCredential
| ClientSecretCredential
| WorkloadIdentityCredential
| DefaultAzureCredential
private subscriptionClient: SubscriptionClient
private logger: Logger

Expand Down
4 changes: 4 additions & 0 deletions packages/azure/src/application/AzureCredentialsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import {
ClientCertificateCredential,
ClientSecretCredential,
DefaultAzureCredential,
WorkloadIdentityCredential,
} from '@azure/identity'
import { SecretManagerServiceClient } from '@google-cloud/secret-manager'
Expand All @@ -16,6 +17,7 @@ export default class AzureCredentialsProvider {
| ClientCertificateCredential
| ClientSecretCredential
| WorkloadIdentityCredential
| DefaultAzureCredential
> {
const clientId = configLoader().AZURE.authentication.clientId
const clientSecret = configLoader().AZURE.authentication.clientSecret
Expand Down Expand Up @@ -43,6 +45,8 @@ export default class AzureCredentialsProvider {
clientId,
certificatePath,
)
case 'MANAGED_IDENTITY':
return new DefaultAzureCredential()
default:
return new ClientSecretCredential(tenantId, clientId, clientSecret)
}
Expand Down