Azure / azure-functions-microsoftgraph-extension

Microsoft Graph extension for Azure Functions
MIT License
46 stars 23 forks source link

Version conflict trying to install the AuthTokens package #56

Closed sayanghosh123 closed 6 years ago

sayanghosh123 commented 6 years ago

Just trying to add the AuthTokens nuget package from a new Function created using VS 2017 to use the Auth bindings from the function code. Running the command - install-package Microsoft.Azure.WebJobs.Extensions.AuthTokens -Version 1.0.0-beta3

Getting this error -

install-package : NU1107: Version conflict detected for Microsoft.Azure.WebJobs. Reference the package directly from the project to resolve this issue. MSGraphExplorer -> Microsoft.Azure.WebJobs.Extensions.AuthTokens 1.0.0-beta3 -> Microsoft.Azure.WebJobs (>= 3.0.0-beta5) MSGraphExplorer -> Microsoft.NET.Sdk.Functions 1.0.13 -> Microsoft.Azure.WebJobs (>= 2.2.0 && < 2.3.0). At line:1 char:1

  • install-package Microsoft.Azure.WebJobs.Extensions.AuthTokens -Versi ...
  • 
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

install-package : Package restore failed. Rolling back package changes for 'MSGraphExplorer'. At line:1 char:1

The error does look legit. Is there a workaround to these? I have validated that "Azure Functions and Web Job Tools" extensions is up to date....

ConnorMcMahon commented 6 years ago

It looks like the requirements for Microsoft.NET.Sdk.Functions 1.0.13 are its .NET 4.6 requirements. This makes me think that your function application is a Functions V1 project, as it is pulling from full framework instead of .NET Core. Make sure to change your function application is a V2 project, and it should start relying on the .NET Standard requirements.

Note that the Microsoft Graph extension is only compatible with Functions V2.

sayanghosh123 commented 6 years ago

That did the trick. Sorry was a silly question, I should have checked. Closing the issue now. Thanks @ConnorMcMahon