diff --git a/sdk/azidentity/managed_identity_credential.go b/sdk/azidentity/managed_identity_credential.go index 1fdea871d447..cf64e837ed9c 100644 --- a/sdk/azidentity/managed_identity_credential.go +++ b/sdk/azidentity/managed_identity_credential.go @@ -72,7 +72,7 @@ func NewManagedIdentityCredential(id string, options *ManagedIdentityCredentialO client.msiType = msiType // check if no clientID is specified then check if it exists in an environment variable if len(id) == 0 { - if options.ID == 1 { + if options.ID == ResourceID { id = os.Getenv("AZURE_RESOURCE_ID") } else { id = os.Getenv("AZURE_CLIENT_ID")