I was toying with Azure Storage Blob PHP Client library the other day and I got a bit confused around how to use it in the BlobRestProxy::createBlobServiceWithTokenCredential
method:
$connectionString = "DefaultEndpointsProtocol=https;BlobEndpoint=https://...";
$access_token = get_token_access($application_id, $application_secret, 'https://...');
$blobClient = BlobRestProxy::createBlobServiceWithTokenCredential($accessToken,$connectionString);
$blobClient->createBlockBlob($containerName, $fileName, $content);
I am getting the following error:
Authentication information is not given in the correct format. Check the value of Authorization header.
I can confirm the token is valid as I can use it to list the blobs in the container using the rest api.