Skip to content

Commit 1115bf8

Browse files
Merge pull request #1116 from bryan-cox/HOSTEDCP-1872
OCPBUGS-42004: Set the Managed Identity client ID
2 parents f6587e5 + d91b4dc commit 1115bf8

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pkg/storage/azure/azure.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,14 @@ func (d *driver) storageAccountsClient(cfg *Azure, environment autorestazure.Env
370370
cred azcore.TokenCredential
371371
err error
372372
)
373-
// MSI Override for ARO HCP
374-
msi := os.Getenv("AZURE_MSI_AUTHENTICATION")
375-
if msi == "true" {
373+
// Managed Identity Override for ARO HCP
374+
managedIdentityClientID := os.Getenv("ARO_HCP_MI_CLIENT_ID")
375+
if managedIdentityClientID != "" {
376376
options := azidentity.ManagedIdentityCredentialOptions{
377377
ClientOptions: azcore.ClientOptions{
378378
Cloud: cloudConfig,
379379
},
380+
ID: azidentity.ClientID(managedIdentityClientID),
380381
}
381382

382383
var err error

pkg/storage/azure/azureclient/azureclient.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,14 @@ func New(opts *Options) (*Client, error) {
8484
if creds == nil {
8585
var err error
8686

87-
// MSI Override for ARO HCP
88-
msi := os.Getenv("AZURE_MSI_AUTHENTICATION")
89-
if msi == "true" {
87+
// Managed Identity Override for ARO HCP
88+
managedIdentityClientID := os.Getenv("ARO_HCP_MI_CLIENT_ID")
89+
if managedIdentityClientID != "" {
9090
options := azidentity.ManagedIdentityCredentialOptions{
9191
ClientOptions: azcore.ClientOptions{
9292
Cloud: cloudConfig,
9393
},
94+
ID: azidentity.ClientID(managedIdentityClientID),
9495
}
9596
creds, err = azidentity.NewManagedIdentityCredential(&options)
9697
if err != nil {

0 commit comments

Comments
 (0)