AzureCliTokenProvider
Reuses whatever identity a developer already authenticated with az login, by shelling out to az account get-access-token.
Meant for local development against a real storage account without ever handing out an account key.
The CLI already caches and refreshes its own token, so rather than parse its locale-formatted expiresOn this re-invokes it on a short, fixed TTL: the extra call is cheap and always correct, where parsing a datetime the CLI does not promise a stable format for would not be.
Synopsis
Section titled “Synopsis”final class AzureCliTokenProvider implements AzureTokenProvider
| Implements | AzureTokenProvider |
| Source | AzureCliTokenProvider.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(AzureCliProcessRunner $processRunner = new ProcOpenAzureCliProcessRunner(…), string $resource = self::STORAGE_RESOURCE): mixed
| Parameter | Type | Description |
|---|---|---|
$processRunner | AzureCliProcessRunner | |
$resource | string |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
getToken(): string |
getToken()
Section titled “getToken()”public function getToken(): string
Returns string