Need an example for generating SAS token for Blob storage in PHP with REST API

Luca Marchal 20 Reputation points
2024-01-03T12:40:13.9133333+00:00

Hi there,

I have a PHP (Laravel) + React.js (with Intertia) app that I'm building that needs to use Azure Blob Storage for image uploading and serving images. I've successfully built an uploader on the frontend that relies on a SAS token. My intent was to use the Valet Key pattern to generate this SAS token from the PHP backend, and serve it to the frontend when the page is rendered (I'm using Socialite on the PHP / Laravel side for authentication with Entra ID).

Now the PHP storage client libraries are being retired, and we're forced to use the raw REST API, I'm really struggling to generate the SAS key on the server side for my valet key pattern. I haven't been able to find a single example online of someone else who's successfully integrated the REST API.

Really struggling here and could do with some guidance and / or an example.

Thanks,

Luca

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,529 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anand Prakash Yadav 7,855 Reputation points Microsoft External Staff
    2024-01-04T11:34:33.72+00:00

    Hello Luca Marchal,

    Thank you for posting your query here!

    The same query has been answered in the following SO thread, please check:

    https://stackoverflow.com/questions/77751969/generating-sas-token-for-azure-blob-storage-in-php-with-rest-api

    Please let us know if you have any further queries. I’m happy to assist you further.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.