简体   繁体   English

Azure媒体服务v3与Azure功能不兼容

[英]Azure Media Services v3 Not Compatible with Azure Function

I am trying to recreate this walkthrough 我正在尝试重新创建此演练

https://docs.microsoft.com/en-us/azure/media-services/latest/stream-files-tutorial-with-api#download-the-sample https://docs.microsoft.com/zh-CN/azure/media-services/latest/stream-files-tutorial-with-api#download-the-sample

as an Azure Function, and it seems there is some incompatibility between the Azure Function SDK and Microsoft.IdentityModel.Clients.ActiveDirectory. 作为Azure函数,似乎Azure Function SDK与Microsoft.IdentityModel.Clients.ActiveDirectory之间存在一些不兼容。 If you try to create a new ArmClientCredentials like so 如果您尝试像这样创建新的ArmClientCredentials

ArmClientCredentials credentials = new ArmClientCredentials(config);

You get an error like so 你会得到这样的错误

Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.4.11002 无法加载文件或程序集'Microsoft.IdentityModel.Clients.ActiveDirectory,Version = 3.19.4.11002

The particular nuget package is added to the project. 特定的nuget包已添加到项目中。 Is this something that requires an additional step not shown here? 这是否需要额外的步骤?

I had a similar issue using Azure Functions using the blob trigger template. 使用blob触发器模板使用Azure Functions时,我遇到了类似的问题。 Instead of using the latest version of Microsoft.IdentityModel.Clients.ActiveDirectory (which is 3.19.4 as of writing) I had to downgrade to the version number that media services package is looking for (indicated in the error). 而不是使用Microsoft.IdentityModel.Clients.ActiveDirectory的最新版本(撰写时为3.19.4),我不得不降级为媒体服务包正在寻找的版本号(错误中指示)。

My project.json that worked for Media Services v2: 我适用于Media Services v2的project.json:

{
  "frameworks": {
    "net46":{
      "dependencies": {
        "windowsazure.mediaservices": "4.1.0.1",
        "windowsazure.mediaservices.extensions": "4.1.0.1",
        "Microsoft.IdentityModel.Clients.ActiveDirectory": "3.13.1",
        "Microsoft.IdentityModel.Protocol.Extensions": "1.0.2.206221351"
      }
    }
   }
}

Kindly check if the setting below works for you and Media Services v3. 请检查以下设置是否适合您和Media Services v3。 At the very least, these should be in your project.json in Azure Function: 至少,这些应该在Azure Function中的project.json中:

{
  "frameworks": {
    "net46":{
      "dependencies": {
        "Microsoft.Azure.Management.Media": "1.0.0",
        "Microsoft.IdentityModel.Clients.ActiveDirectory": "3.19.4",
        "WindowsAzure.Storage": "9.1.1"
      }
    }
   }
}

I was able to solve this problem by rolling down the version of the package to 3.14. 通过将软件包的版本降低到3.14,可以解决此问题。 here is the repo of the solution (using csproj) 这是解决方案的仓库(使用csproj)

https://github.com/isaac2004/AzureMediaServicesDemo https://github.com/isaac2004/AzureMediaServicesDemo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM