如何在 Azure 媒体服务中为资产设置 AlternateId?

how to set AlternateId for an asset in azure media service?

我正在尝试向存储在 Azure 媒体服务中的每个视频添加一些自定义元数据。作为其中的一部分,我正在尝试更改存储在 Azure 媒体服务中的资产的 AlternateId 的值。

我可以看到密钥作为 IAsset

的一部分可用

当您使用 CloudMediaContext 创建或编码资产时,您将交回资产。此时可以设置AlternateId并调用Update.

      IAsset inputAsset = _mediaContext.Assets.CreateFromBlob(blob, 
                            storageCredentials, AssetCreationOptions.None);

      inputAsset.AlternateId = assetId.ToString();
      inputAsset.Update();