Search code examples
azureazure-media-services

presetOverride when creating Azure Media Services v3 Job


When creating an Azure Media Services Job via the REST API, I cannot set a presetOverrides property on the JobOutputAsset as defined in the documentation: https://learn.microsoft.com/en-us/rest/api/media/jobs/create#joboutputasset

My request body is:

{
 "properties": {
    "input": {
      "@odata.type": "#Microsoft.Media.JobInputAsset",
      "assetName": "inputAsset"
    },
    "outputs": [
      {
        "@odata.type": "#Microsoft.Media.JobOutputAsset",
        "assetName": "outputAsset",
        "label": "en-US",
        "presetOverride": {
            "@odata.type": "#Microsoft.Media.AudioAnalyzerPreset",
            "audioLanguage": "en-US",
            "mode": "Basic"
        }
      }
    ],
    "priority" : "Normal"
 }
}

The error message thrown is:

{
    "error": {
        "code": "InvalidResource",
        "message": "The property 'presetOverride' does not exist on type 'Microsoft.Media.JobOutputAsset'. Make sure to only use property names that are defined by the type."
    }
}

When removing the presetOverride data, everything works as expected. The official documentation clearly states that the Microsoft.Media.JobOutputAsset does have a presetOverride property though. What am I doing wrong?


Solution

  • It is important to select the correct API version when communicating with the Azure Media Services REST API.

    In this case, api version 2020-05-01 from the Azure Media Services Postman examples was used. But the presetOverride option is only available starting with version 2021-06-01.

    Setting api-version=2021-06-01 as a GET parameter enables Preset Overrides.