AzureTokenProvider
Produces an Azure AD access token for whichever resource its implementation was built for, caching and refreshing it however fits the source (a token exchange, a CLI call, a chain of both).
STORAGE_RESOURCE is every implementation’s own default, since Blob/Table storage is what AzureCredentialFactory builds one for; a caller that needs a token for a different AAD-protected API (e.g. Log Analytics) passes its own resource/scope instead, via AzureTokenProviderFactory or a provider’s constructor directly.
Synopsis
Section titled “Synopsis”interface AzureTokenProvider
| Implemented by | AzureCliTokenProvider, ChainedTokenProvider, WorkloadIdentityTokenProvider |
| Source | AzureTokenProvider.php |
Constants
Section titled “Constants”| Constant | Value | Description |
|---|---|---|
STORAGE_RESOURCE | 'https://storage.azure.com/' | The az account get-access-token --resource form: an https URL ending in /. |
Methods
Section titled “Methods”| Method | Description |
|---|---|
getToken(): string |
getToken()
Section titled “getToken()”abstract public function getToken(): string
Returns string
| Throws | When |
|---|---|
AzureStorageException | If no token could be obtained. |