good day. Is it possible to access a private blob from azure storage without using a SAS url or SAS token to stream it on the shaka player? The shaka player keeps throwing error like this: enter image description here

GET https://azure-url/ezdrm-test/dash_package_12072023_051840/h264_360p.mp4 401 (Server failed to authenticate the request. Please refer to the information in the www-authenticate header.)

I've already read, watch and tried the samples and documentation of azure but it was using only a SAS url or token. Is anybody have tried this one?

Appreciate your response.

1

There are 1 answers

1
Venkatesan On

Is it possible to access a private blob from Azure storage without using a SAS URL or SAS token to stream it on the Shaka player?

No, It is not possible to access a private blob without a SAS URL or SAS token.

If you need to access private either you need an SAS token or Microsoft entra ID access token.

If you need to access the private blob with an access token, first you need to create one application in the portal.

After creating an application, you need to assign the Storage blob data contributor role to your application.

enter image description here

Using the above application, I created an access-token with the client credential flow through Postman.

Postman:

GET https://login.microsoftonline.com/<tenantid>/oauth2/v2.0/token
    client_id:ClientID
    client_secret:ClientSecret
    scope:https://storage.azure.com/.default
    grant_type:client_credentials

enter image description here

Now, Using the above access token with x-ms-version in the header, I can able to fetch the video from Azure blob storage.

Postman:

GET https://venkat789.blob.core.windows.net/demo/sample7.mp4
Headers:
 Authorization:Bearer <Access token>
 x-ms-version:2021-06-08

enter image description here

Reference:

Authorize access to blobs using Microsoft Entra ID - Azure Storage | Microsoft Learn