Azure issue with AAD and blob

Rohit Shindhe 1 Reputation point
2021-01-25T15:46:52.9+00:00

Hello Team,

I am working on a music project where client will upload the mp4 and mp3 files using Azure media services (Subscription ID: 81bffe9f-8aab-4147-a2b3-55b062b5a906).

I am using Azure Rest API services through Postman. I am facing issue with Azure AD as even I made it as never to expire, its asking me to refresh token every hour. I have registered the app and followed all the steps. Still no luck.

I am using Create Job Azure API to upload files and the format in request body is as below:

{
"properties": {
"input": {
"@odata.type": "#Microsoft.Media.JobInputHttp",
"baseUri": "https://teststoreag.blob.core.windows.net/asset-1140a08b-8160-46b3-a2ea-ccb85ebbb468/",
"files": [
"sample.mp4"
]
},
"outputs": [
{
"@odata.type": "#Microsoft.Media.JobOutputAsset",
"assetName": "azuretest"
}
],
"priority" : "Normal",
"correlationData": {
"myKey1" :"my custom correlation metadata for this job"
}
}
}

My file size is 3 MB. But still after success uploading in Postman, I am unable to find the file in Azure container.

Please assist on this ASAP, as I have project deadlines.

Thanks,
Rohit Shindhe

Azure Media Services
Azure Media Services
A group of Azure services that includes encoding, format conversion, on-demand streaming, content protection, and live streaming services.
307 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,489 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,851 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 26,241 Reputation points Microsoft Employee
    2021-01-26T17:14:57.447+00:00

    @Rohit Shindhe with regards to your asset not uploading, you can use create or update asset API where you don't need to specify the baseUri, just the asset name in the body:

    {  
      "properties": {  
        "input": {  
          "@odata.type": "#Microsoft.Media.JobInputAsset",  
          "assetName": "job1-InputAsset"  
        },  
        "outputs": [  
          {  
            "@odata.type": "#Microsoft.Media.JobOutputAsset",  
            "assetName": "job1-OutputAsset"  
          }  
        ],  
        "correlationData": {  
          "key1": "value1",  
          "Key 2": "Value 2"  
        }  
      }  
    }  
    

    Since you are specifying the baseUri, your issue is it's not in the correct SAS URL format. To get the correct format, you can use the list List Container SAS API to ensure you're uploading your assets to the correct storage container.

    Going that route, you shouldn't need an AD token as the SAS url will have the correct permissions in the sig.

    Regards,
    Ryan

    0 comments No comments