【Azure 媒体服务】Azure Media Service Explorer 5.4.3.0 不能连接Media Service, 错误消息提示 BadRequest 和 Forbidden

简介: 【Azure 媒体服务】Azure Media Service Explorer 5.4.3.0 不能连接Media Service, 错误消息提示 BadRequest 和 Forbidden

问题描述

Azure Media Service Explorer 5.4.3.0 不能连接Media Service, 错误消息提示 BadRequest 和 Forbidden。

截图如下: BadRequest

Forbidden

 

问题解决

BadRequest 和 Forbidden 是在操作中遇见的两个问题,所以需要分开单独分析:

1)分析BadRequest的问题,发现根源是Media Service Explorer 5.4.3.0的一个Bug,在连接的时候请求AAD认证时返回400 Bad Request错误。但是通过降低到5.4.2.1的版本时,能够正常连接到Azure媒体服务(Media Servcie).

2)分析Forbidden问题,这是因为在认证时候,401没有足够的权限而引起的。所以第一步就是检测当前使用的AAD 服务主体(Service Principal) 是否在Media Service的访问控制【Access Control(IAM)】 中被赋予了足够的权限。如:Media Services Account Administrator

注:使用Azure Media Service Explorer工具连接Media Service时候,需要注意时连接的V3, 或者是V2版本的媒体服务。因为它们的终结点是不一样的。如下的高亮部分:

V2 和V3认证的时候终结点是不一样的。
####V3:
{
    "AadClientId": "<<INSERT_AZURE_AD_APP_ID_HERE>>",
    "AadSecret": "<<INSERT_AZURE_AD_APP_SECRET_HERE>>",
    "AadTenantDomain": "xxx",
    "AadTenantId": "xx",
    "AccountName": "xx",
    "ResourceGroup": "xx",
    "SubscriptionId": "xxx",
    "ArmAadAudience": "https://management.core.chinacloudapi.cn",
    "ArmEndpoint": "https://management.chinacloudapi.cn"
}
####V2:
{
    "AadClientId": "<<INSERT_AZURE_AD_APP_ID_HERE>>",
    "AadSecret": "<<INSERT_AZURE_AD_APP_SECRET_HERE>>",
    "AadTenantDomain": "xxx",
    "AadTenantId": "xxx",
    "AccountName": "xx",
    "ResourceGroup": "xx",
    "SubscriptionId": "xx",
    "Location": "null",
    "AmsApiResource": "https://rest.media.chinacloudapi.cn",
    "AmsRestApiEndpoint": "https://testmediaservice.restv2.chinanorth.media.chinacloudapi.cn/api/"
}

关于如何从Azure Media Service中获取用于连接的JSON文件,完全不用担心,可以根据以下步骤获取:

Azure Media Service 门户 --> 媒体服务 API访问权限 -->  查看V3和V2的用于连接的JSON文件

 

 

参考文档

Azure 媒体服务浏览器https://docs.microsoft.com/zh-cn/azure/media-services/latest/media-services-apis-overview#azure-media-services-explorer

相关文章
|
25天前
|
JSON API 开发工具
【Azure 应用服务】调用Azure REST API来获取 App Service的访问限制信息(Access Restrictions)以及修改
【Azure 应用服务】调用Azure REST API来获取 App Service的访问限制信息(Access Restrictions)以及修改
|
25天前
|
安全 API 数据安全/隐私保护
【Azure App Service】通过Visual Studio部署Azure App Service 遇见 401 'Unauthorized'错误
【Azure App Service】通过Visual Studio部署Azure App Service 遇见 401 'Unauthorized'错误
|
25天前
|
JavaScript 前端开发 API
【Azure Developer】use @azure/arm-monitor sdk 遇见 ManagedIdentityCredential authentication failed.(status code 500)
【Azure Developer】use @azure/arm-monitor sdk 遇见 ManagedIdentityCredential authentication failed.(status code 500)
|
25天前
|
安全 Windows
【Azure 云服务】Azure Cloud Service中的错误事件 Error Event(Defrag/Perflib) 解答
【Azure 云服务】Azure Cloud Service中的错误事件 Error Event(Defrag/Perflib) 解答
|
28天前
|
存储 编解码 开发工具
【Azure媒体服务 Azure Media Service】Azure Media Service中Stream Endpoint 说明 (流式处理终结点)
【Azure媒体服务 Azure Media Service】Azure Media Service中Stream Endpoint 说明 (流式处理终结点)
|
25天前
|
安全 API 网络安全
【Azure API 管理】APIM不能连接到 App Service (APIM cannot connect to APP service)
【Azure API 管理】APIM不能连接到 App Service (APIM cannot connect to APP service)
|
25天前
|
PHP Windows
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
|
25天前
|
Java 容器
【Azure 媒体服务】记使用 Media Service 的官网示例代码 Audio Analyzer 出现卡顿在 Creating event processor host .. 直到 Timeout 问题
【Azure 媒体服务】记使用 Media Service 的官网示例代码 Audio Analyzer 出现卡顿在 Creating event processor host .. 直到 Timeout 问题
|
25天前
|
存储 网络安全 数据中心
【Azure 存储服务】App Service 访问开启防火墙的存储账号时遇见 403 (This request is not authorized to perform this operation.)
【Azure 存储服务】App Service 访问开启防火墙的存储账号时遇见 403 (This request is not authorized to perform this operation.)
【Azure 存储服务】App Service 访问开启防火墙的存储账号时遇见 403 (This request is not authorized to perform this operation.)
|
26天前
|
Shell
【Azure 应用服务】App Service服务无法启动,打开Kudu站点,App Service Editor 页面均抛出:The service is unavailable
【Azure 应用服务】App Service服务无法启动,打开Kudu站点,App Service Editor 页面均抛出:The service is unavailable