您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

步骤 3 - 进行设置,以迁移到 V3 REST API 或客户端 SDKStep 3 - Set up to migrate to the V3 REST API or client SDK

迁移指南徽标


迁移步骤 2

下文描述了将环境设置为使用媒体服务 V3 API 需要执行的步骤。The following describes the steps to take to set up your environment to use the Media Services V3 API.

SDK 模型SDK model

V2 API 中有两个不同的客户端 SDK,一个用于管理 API,可同构它以编程方式创建帐户,而另一个用于管理资源。In the V2 API, there were two different client SDKs, one for the management API, which allowed programmatic creation of accounts, and one for resource management.

以前,除了 AMS 帐户的特定 V2 REST API 终结点,开发人员还会使用 Azure 服务主体客户端 ID 和客户端密码。Previously, developers would work with an Azure service principal client ID and client secret, along with a specific V2 REST API endpoint for their AMS account.

V3 API 基于 Azure 资源管理 (ARM)。The V3 API is Azure Resource Management (ARM) based. 它使用 Azure Active Directory (Azure AD) 服务主体 ID 和密钥连接到 API。It uses Azure Active Directory (Azure AD) service principal IDs and keys to connect to the API. 开发人员将需要创建服务主体或托管标识才能连接到 API。Developers will need to create service principals or managed identities to connect to the API. 在 V3 API 中,API 会使用标准 ARM 终结点,对其他所有 Azure 服务使用相似且一致的模型。In the V3 API, the API uses standard ARM endpoints, uses a similar and consistent model to all other Azure services.

以前使用 ARM 管理 API 2015-10-01 版本来管理其 V2 帐户的客户应使用支持 V3 API 访问的 ARM 管理 API 2020-05-01 版本。Customers previously using the 2015-10-01 version of the ARM management API to manage their V2 accounts should use the 2020-05-01 version of the ARM management API supported for V3 API access.

创建新的媒体服务帐户进行测试Create a new media services account for testing

在 Azure 门户中,按照有关设置环境的快速入门步骤进行操作。Follow the quickstart steps for setting up your environment using the Azure portal. 选择 API 访问和服务主体身份验证,来生成用于此测试帐户的新的 Azure AD 应用程序 ID 和机密。Select API access and service principal authentication to generate a new Azure AD application ID and secrets for use with this test account.

创建媒体服务帐户Create a media services account. 获取用于访问媒体服务 API 的凭据Get credentials to access Media Services API.

下载所选的客户端 SDK 并设置环境Download client SDK of your choice and set up your environment

备注

社区 PHP SDK 无法再用于 V3 上的 Azure 媒体服务。A community PHP SDK is no longer available for Azure Media Services on V3. 如果正在 V2 中使用 PHP,应直接在代码中迁移到 REST API。If you're using PHP on V2, you should migrate to the REST API directly in your code.

Open API 规范Open API specifications

  • V3 基于统一的 API 接口,该接口公开了在 Azure 资源管理器之上构建的管理和操作功能。V3 is based on a unified API surface, which exposes both management and operations functionality built on Azure Resource Manager. Azure 资源管理器模板可用于创建和部署转换、流式处理终结点、直播活动等等。Azure Resource Manager templates can be used to create and deploy transforms, streaming endpoints, live events, and more.

  • OpenAPI 规范(之前称为 Swagger)文档说明了所有服务组件的架构。The OpenAPI Specification (formerly called Swagger) document explains the schema for all service components.

  • 所有客户端 SDK 都是从 GitHub 上发布的 Open API 规范派生和生成的。All client SDKs are derived and generated from the Open API specification published on GitHub. 在本文发布时,最新的 Open API 规范在 GitHub 中公开进行维护。At the time of publication of this article, the latest Open API specifications are maintained publicly in GitHub. 2020-05-01 版本是最新的稳定版本The 2020-05-01 version is the latest stable release.

使用 Postman 进行媒体服务 v3 REST API 调用。Use Postman for Media Services v3 REST API calls. 请阅读 REST API 参考页面Read the REST API reference pages.

应在 Postman 集合中使用 2020-05-01 版本字符串。You should use the 2020-05-01 version string in the Postman collection.