Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use Microsoft.Graph.Beta instead of Microsoft.Graph? #506

Closed
dansmitt opened this issue Aug 27, 2020 · 13 comments
Closed
Labels
enhancement New feature or request fixed
Milestone

Comments

@dansmitt
Copy link

Both Libraries are using the same namespaces… We have to use the Beta because of the new Intune fuctions and it produces reference errors.

Please evaluate if this is possible.

@dansmitt
Copy link
Author

dansmitt commented Aug 28, 2020

@jmprieur how do you think Microsoft should handle this? The namespace in Microsoft.Graph and Microsoft.Graph.Beta are the same... We definately need the new functions of Microsoft.Graph.Beta to integration Win32Lob apps in intune. This is not possible with Microsoft.Graph. This is very inconsistent.

@jmprieur
Copy link
Collaborator

@darrelmiller: what would you suggest?
when would Intune be available in Graph v1.0 ?

@dansmitt
Copy link
Author

@jmprieur Intune Graph v1.0 is available since I think the beginning. The whole world is waiting for the release of the actual Beta 😆

@darrelmiller
Copy link
Contributor

@schmid37 Microsoft.Graph.Beta is a superset of the Microsoft.Graph library so you could use the Microsoft.Graph.Beta library instead of Microsoft.Graph. It would mean that your client is calling beta for all of the resources. However, due to the fact that we don't allow breaking changes, calling the beta APIs would not likely cause issues.

The alternate approach to use extern alias to reference both assemblies even though they use the same namespace. https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/extern-alias

@dansmitt
Copy link
Author

dansmitt commented Aug 28, 2020

@darrelmiller Thanks for the reply. We use the Microsoft.Graph.Beta for sure. Because we need to integrate Win32Lob apps in Intune. This is only possible with the beta.

The question is, what impacts would @jmprieur have when they would use Microsoft.Graph.Beta instead of Microsoft.Graph?

An other question is, when will you find the consistency between Microsoft.Graph and Microsoft.Graph.Beta? Maybe through a release? Maybe through the possibility to provide previews within only one NuGet package?

Nobody understands why there are two libraries with the same namespace. I don't know any company, we work with, which is amused about this situation. Companies which need to integrate Win32Lob apps in Intune are reliant on using an beta... This is not really acceptable.

The alternate approach is a workaround with limits... So I already tried this and it won't really work with referenced projects in a solution.

@gavinmnz
Copy link

We're also encountering this issue as we're attempting to build an application using the Bookings API ahead of its official release, this is being done in conjunction with Microsoft NZ. We therefore need to use the Beta API but can't alongside this Auth library currently.

I note that on the original feature request that was added in 0.3.0-preview (#427) there were references to calling the Beta API however that doesn't appear to be achievable currently.

@jmprieur
Copy link
Collaborator

@schmid37 @gavinmn
Would that work for you if we splat Microsoft.Identity web into another NuGet package (for instance Microsoft.Identity.Web.MicrosoftGraph) to bring the MicrosoftGraph specific classes?

We could then have two:

  • Microsoft.Identity.Web.MicrosoftGraph (Leveraging the MicrosoftGraph SDK)
  • Microsoft.Identity.Web.MicrosoftGraphBeta (Leveraging the MicrosoftGraph SDK Beta SDK)

The ASP.NET Core template would use Microsoft.Identity.Web.MicrosoftGraph, but you/customers could substitute it with Microsoft.Identity.Web.MicrosoftGraphBeta?
The model would be the same as the Graph SDK (that is the same assemblies), which arguably is a bit weird indeed.

cc: @jennyf19 @darrelmiller @henrik-me @pmaytak

@dansmitt
Copy link
Author

@jmprieur sounds good to me. Hopefully not to forget that this is only a workaround. That would work for us.

@darrelmiller is it possible to get a clear way with the Graph SDK? Will this case remain after .Net 5 release?

@jmprieur
Copy link
Collaborator

@gavinmnz

I note that on the original feature request that was added in 0.3.0-preview (#427) there were references to calling the Beta API however that doesn't appear to be achievable currently.

Unless I did not understand anything, you can always call the Graph beta endpoint (you change the BaseURL like here) with the non-beta Graph SDK ?

@darrelmiller
Copy link
Contributor

@jmprieur We have an issue open for creating Microsoft.Graph.Web microsoftgraph/msgraph-sdk-dotnet#766. We can also create Microsoft.Graph.Beta.Web. The Microsoft Graph libraries should take a dependency on the Microsoft.Identity libraries, not the other way around.

@schmid37 Microsoft.Graph and Microsoft.Graph.Beta will always be different as long as we are continuing to develop Microsoft Graph. New features are being added into Microsoft.Graph all the time and they go through a beta phase before moving to V1. For this reason Microsoft.Graph.Beta will always be preview because the teams that build those APIs do not want customers to take a production dependency on those APIs unless the customer is prepared to accept breaking changes in production.

If there are Intune related APIs on Microsoft Graph that are in beta that you need to have in a production application, then the Intune team needs to hear about it. It is the Intune team that make the decision about promoting APIs from beta to V1.0 when they are ready. We on the Microsoft Graph Developer Experience team would be delighted to see those APIs move out of beta.

Regarding the multiple namespaces, that is an issue that I own and we had extensive discussions with customers on whether the two packages should have the same namespace or not. I did not have any customers with strong feelings about them being in different namespaces. I am open to hearing additional feedback on this. We could add Microsoft.Graph.Beta namespace into the beta package, but we need to consider the consequences of that choice.

@dansmitt
Copy link
Author

@darrelmiller Thanks for the feedback! Seems to be logic. To be honest, it would be easier to deal with an explicit Beta namespace to know what you are using in the code itself. It's a mess when you have the Microsoft.Graph referenced from an external NuGet package, but your project uses the Microsoft.Graph.Beta. We are very open for solutions. Doesn't matter which way.
I think a good way is to open an issue in the microsoftgraph/msgraph-sdk-dotnet repo to have a transparent discussion with other customers.

@jmprieur
Copy link
Collaborator

jmprieur commented Aug 31, 2020

@jennyf19
@darrelmiller and I just synced and we propose to split Microsoft.Identity.Web into:

This way we allow the scenario that @schmid37 and @gavinmnz want.

Note that this is a breaking change, so we'd want to do it before GA, hence the hi priority

Work to be done:
this work item

  • create a new project, and a new NuGet package (no need to change the CI build)

  • move the 3 files into that project (we can still keep the same namespaces)

  • update our test apps leveraging graphs to reference the new project

  • update our project templates to reference the new NuGet package (back to conditionally to using Graph ....)

  • update the release definition to add pushing the new NuGet package

  • Propose a PR for ASP.NET Core to add a reference to the new NuGet package. From their point of view this would not change anything else if we keep the same namespace.

  • Do the same steps for Microsoft.Identity.Web.MicrosoftGraphBeta. The code would be as links to the previous project

cc: @pmaytak @henrik-me

@jmprieur jmprieur added this to the 0.3.2-preview milestone Aug 31, 2020
jmprieur added a commit that referenced this issue Sep 1, 2020
Separate Microsoft Graph support from Microsoft.Identity.web

Needs more work on templates.
jmprieur added a commit that referenced this issue Sep 2, 2020
* Fix for #506
_ Separate Microsoft Graph support from Microsoft.Identity.web
_  Udapting the templates
_ Addressing PR comments
@jmprieur jmprieur added the fixed label Sep 2, 2020
@jennyf19
Copy link
Collaborator

Included in 0.4.0-preview release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed
Projects
None yet
Development

No branches or pull requests

5 participants