【发布时间】:2017-11-28 21:07:56
【问题描述】:
我正在尝试使用 Azure 媒体服务对上传到我的 Web 应用程序的视频进行编码。现在 ACS 已从 AMS .net 扩展和 api 中删除,似乎唯一的连接方式是使用 Azure AD 凭据。所以我已经在 AAD 注册了服务主体,并在 AMS 上授予了贡献者权限。
所有权限似乎都正确,我尝试运行this sample code,但 Azure 拒绝颁发令牌。
第 80 行失败:
IAsset sourceAsset = _sourceContext.Assets.Where(a => a.Id == _sourceAssetID).First();
与针对 AMS 的任何其他操作相同。
"ExceptionMessage": "Error HRESULT E_FAIL has been returned from a call to a COM component.",
"ExceptionType": "System.Runtime.InteropServices.COMException",
"StackTrace": " at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.WebUI.<AcquireAuthorizationAsync>d__12.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.<AcquireAuthorizationAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.<PreTokenRequest>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenHandlerBase.<RunAsync>d__57.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenCommonAsync>d__39.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenAsync>d__28.MoveNext()"
此错误消息来自 AD。
想知道我是否需要在 Azure Api 应用上做任何事情来完成这项工作?
【问题讨论】:
标签: azure azure-web-app-service azure-media-services azure-api-apps