Module: AzIdentity::AzureEnvironment

Included in:
Identity::BaseClient, RedisCredentialsProvider
Defined in:
lib/az_identity/azure_environment.rb

Instance Method Summary collapse

Instance Method Details

#authority_url(environment = AzIdentity::Constants::AZURE_CLOUD) ⇒ Object

The Microsoft Entra authority (login host) differs per cloud. On AKS with workload identity, AZURE_AUTHORITY_HOST is injected with the correct value and takes precedence over this fallback (see WorkloadIdentityClient).



10
11
12
13
14
15
16
17
18
19
# File 'lib/az_identity/azure_environment.rb', line 10

def authority_url(environment = AzIdentity::Constants::AZURE_CLOUD)
  case environment
  when AzIdentity::Constants::AZURE_CHINA_CLOUD
    'https://login.partner.microsoftonline.cn'
  when AzIdentity::Constants::AZURE_US_GOVERNMENT
    'https://login.microsoftonline.us'
  else
    'https://login.microsoftonline.com'
  end
end

#redis_resource(_environment = AzIdentity::Constants::AZURE_CLOUD) ⇒ Object



28
29
30
# File 'lib/az_identity/azure_environment.rb', line 28

def redis_resource(_environment = AzIdentity::Constants::AZURE_CLOUD)
  'https://redis.azure.com'
end

#storage_resource(_environment = AzIdentity::Constants::AZURE_CLOUD) ⇒ Object

The OAuth resource/audience is the same in every cloud (only the authority differs), so these intentionally ignore the environment. https://learn.microsoft.com/en-us/rest/api/storageservices/authorize-with-azure-active-directory



24
25
26
# File 'lib/az_identity/azure_environment.rb', line 24

def storage_resource(_environment = AzIdentity::Constants::AZURE_CLOUD)
  'https://storage.azure.com'
end