Search code examples
azureazure-media-services

Is there any API to List Assets in the Media Services account which belongs to particular storage account


I have looked into below API for listing assets in Azure Media Service.

https://learn.microsoft.com/en-us/rest/api/media/assets/list

This API does not allow to filter based on 'properties/storageAccountName'. Is there any other way or any other API to list assets in Azure Media Services of particular storage account which is attached to that media service.


Solution

  • Assuming you're using Media Services API v3, check the filtering and ordering options of entities on Microsoft Docs, you can see all the options that are supported in the REST API scope. Unfortunately this does not include the property you require, so your best bet is to parse the response, and filter it by yourself.

    Edit: Even if you manage to input a query like properties/storageAccountName eq 'test' You get a status code of 400 with a response body:

    {
      "error": {
        "code": "InvalidQuery",
        "message": "Filter by 'properties/storageAccountName' is not allowed."
      }
    }