-
Notifications
You must be signed in to change notification settings - Fork 4.1k
{HDInsight}Hdi migrate Microsoft.Azure.Graph to MicrosoftGraph #17219
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
Changes from 2 commits
1c3e574
403571c
669d80f
b46e5c7
3580ac3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -14,11 +14,12 @@ | |||||
|
|
||||||
| using Microsoft.Azure.Commands.Common.Authentication; | ||||||
| using Microsoft.Azure.Commands.Common.Authentication.Abstractions; | ||||||
| using Microsoft.Azure.Commands.Common.MSGraph.Version1_0; | ||||||
| using Microsoft.Azure.Commands.Common.MSGraph.Version1_0.Applications.Models; | ||||||
| using Microsoft.Azure.Commands.HDInsight.Commands; | ||||||
| using Microsoft.Azure.Commands.HDInsight.Models; | ||||||
| using Microsoft.Azure.Commands.HDInsight.Models.Management; | ||||||
| using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; | ||||||
| using Microsoft.Azure.Graph.RBAC.Version1_6; | ||||||
| using Microsoft.Azure.Management.HDInsight.Models; | ||||||
| using Microsoft.WindowsAzure.Commands.Common; | ||||||
| using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; | ||||||
|
|
@@ -664,20 +665,20 @@ private Guid GetApplicationId(Guid applicationId) | |||||
| return applicationId; | ||||||
| } | ||||||
|
|
||||||
| GraphRbacManagementClient graphClient = AzureSession.Instance.ClientFactory.CreateArmClient<GraphRbacManagementClient>( | ||||||
| MicrosoftGraphClient graphClient = AzureSession.Instance.ClientFactory.CreateArmClient<MicrosoftGraphClient>( | ||||||
| DefaultProfile.DefaultContext, AzureEnvironment.Endpoint.Graph); | ||||||
|
|
||||||
| graphClient.TenantID = DefaultProfile.DefaultContext.Tenant.Id.ToString(); | ||||||
|
|
||||||
| Microsoft.Azure.Graph.RBAC.Version1_6.Models.ServicePrincipal sp = null; | ||||||
| MicrosoftGraphServicePrincipal sp = null; | ||||||
| try | ||||||
| { | ||||||
| sp = graphClient.ServicePrincipals.Get(ObjectId.ToString()); | ||||||
| sp = graphClient.ServicePrincipals.GetServicePrincipalWithHttpMessagesAsync(ObjectId.ToString()).Result.Body;//graphClient.ServicePrincipals.Get(ObjectId.ToString()); | ||||||
|
||||||
| sp = graphClient.ServicePrincipals.GetServicePrincipalWithHttpMessagesAsync(ObjectId.ToString()).Result.Body;//graphClient.ServicePrincipals.Get(ObjectId.ToString()); | |
| sp = graphClient.ServicePrincipals.GetServicePrincipal(ObjectId.ToString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use AzPSArgumentException so we can get detailed telemetry data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This migration might have impact on customers because the permission required to call AAD graph and MS graph APIs are different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed