ServicePrincipalCredentials Class

Credentials object for Service Principle Authentication. Authenticates via a Client ID and Secret.

Optional kwargs may include:

  • cloud_environment (msrestazure.azure_cloud.Cloud): A targeted cloud environment

  • china (bool): Configure auth for China-based service, default is 'False'.

  • tenant (str): Alternative tenant, default is 'common'.

  • resource (str): Alternative authentication resource, default is 'https://management.core.windows.net/'.

  • verify (bool): Verify secure connection, default is 'True'.

  • timeout (int): Timeout of the request in seconds.

  • proxies (dict): Dictionary mapping protocol or protocol and hostname to the URL of the proxy.

  • cache (adal.TokenCache): A adal.TokenCache, see ADAL configuration

for details. This parameter is not used here and directly passed to ADAL.

Inheritance
ServicePrincipalCredentials

Constructor

ServicePrincipalCredentials(client_id, secret, **kwargs)

Parameters

client_id
str
Required

Client ID.

secret
str
Required

Client secret.

Methods

set_token

Get token using Client ID/Secret credentials.

set_token

Get token using Client ID/Secret credentials.

set_token()

Exceptions

<xref:AuthenticationError if credentials invalid>, <xref:or call fails.>