Skip to content

Commit

Permalink
configure supports managed-identity true in config.json.
Browse files Browse the repository at this point in the history
  • Loading branch information
daviditkin committed Dec 14, 2024
1 parent 0c31b43 commit f326d17
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
2 changes: 2 additions & 0 deletions cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ func configure() error {
config.AzUsername.Set(upn)
config.AzPassword.Set(password)
}
} else if authMethod == enums.ManagedIdentity {
config.AzUseManagedIdentity.Set(true)
} else if secret, err := prompt("Client Secret", nil, true); err != nil {
return err
} else {
Expand Down
35 changes: 18 additions & 17 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,23 +240,24 @@ func newAzureClient() (client.AzureClient, error) {
}

config := client_config.Config{
ApplicationId: config.AzAppId.Value().(string),
Authority: config.AzAuthUrl.Value().(string),
ClientSecret: config.AzSecret.Value().(string),
ClientCert: clientCert,
ClientKey: clientKey,
ClientKeyPass: config.AzKeyPass.Value().(string),
Graph: config.AzGraphUrl.Value().(string),
JWT: config.JWT.Value().(string),
Management: config.AzMgmtUrl.Value().(string),
MgmtGroupId: config.AzMgmtGroupId.Value().([]string),
Password: config.AzPassword.Value().(string),
ProxyUrl: config.Proxy.Value().(string),
RefreshToken: config.RefreshToken.Value().(string),
Region: config.AzRegion.Value().(string),
SubscriptionId: config.AzSubId.Value().([]string),
Tenant: config.AzTenant.Value().(string),
Username: config.AzUsername.Value().(string),
ApplicationId: config.AzAppId.Value().(string),
Authority: config.AzAuthUrl.Value().(string),
ClientSecret: config.AzSecret.Value().(string),
ClientCert: clientCert,
ClientKey: clientKey,
ClientKeyPass: config.AzKeyPass.Value().(string),
Graph: config.AzGraphUrl.Value().(string),
JWT: config.JWT.Value().(string),
Management: config.AzMgmtUrl.Value().(string),
MgmtGroupId: config.AzMgmtGroupId.Value().([]string),
Password: config.AzPassword.Value().(string),
ProxyUrl: config.Proxy.Value().(string),
RefreshToken: config.RefreshToken.Value().(string),
Region: config.AzRegion.Value().(string),
SubscriptionId: config.AzSubId.Value().([]string),
Tenant: config.AzTenant.Value().(string),
Username: config.AzUsername.Value().(string),
ManagedIdentity: config.AzUseManagedIdentity.Value().(bool),
}
return client.NewClient(config)
}
Expand Down

0 comments on commit f326d17

Please sign in to comment.