{HDInsight}Hdi migrate Microsoft.Azure.Graph to MicrosoftGraph#17219
{HDInsight}Hdi migrate Microsoft.Azure.Graph to MicrosoftGraph#17219BethanyZhou merged 5 commits intoAzure:mainfrom
Conversation
403571c to
669d80f
Compare
isra-fel
left a comment
There was a problem hiding this comment.
Please put the following content in the help document of NewAzureHDInsightClusterCommand:
The cmdlet may call below Microsoft Graph API according to input parameters:
GET /servicePrincipals/{id}
src/HDInsight/HDInsight/ChangeLog.md
Outdated
| - Additional information about change #1 | ||
| --> | ||
| ## Upcoming Release | ||
| This release migrates Microsoft.Azure.Graph SDK to MicrsoftGraph SDK, there is not customer impact. |
There was a problem hiding this comment.
This migration might have impact on customers because the permission required to call AAD graph and MS graph APIs are different.
| This release migrates Microsoft.Azure.Graph SDK to MicrsoftGraph SDK, there is not customer impact. | |
| This release migrates Microsoft.Azure.Graph SDK to MicrsoftGraph SDK. |
| try | ||
| { | ||
| sp = graphClient.ServicePrincipals.Get(ObjectId.ToString()); | ||
| sp = graphClient.ServicePrincipals.GetServicePrincipalWithHttpMessagesAsync(ObjectId.ToString()).Result.Body;//graphClient.ServicePrincipals.Get(ObjectId.ToString()); |
There was a problem hiding this comment.
You can use this extension method to simplify code: https://github.com/Azure/azure-powershell-common/blob/main/src/Graph.Rbac/MicrosoftGraph/Version1_0/Applications/ServicePrincipalsOperationsExtensions.cs#L210
| sp = graphClient.ServicePrincipals.GetServicePrincipalWithHttpMessagesAsync(ObjectId.ToString()).Result.Body;//graphClient.ServicePrincipals.Get(ObjectId.ToString()); | |
| sp = graphClient.ServicePrincipals.GetServicePrincipal(ObjectId.ToString()); |
| { | ||
| string errorMessage = e.Message + ". Please specify Application Id explicitly by providing ApplicationId parameter and retry."; | ||
| throw new Microsoft.Azure.Graph.RBAC.Version1_6.Models.GraphErrorException(errorMessage); | ||
| throw new Exception(errorMessage); |
There was a problem hiding this comment.
Please use AzPSArgumentException so we can get detailed telemetry data.
…powershell into HdiMigrate2MSGraph
|
Hi @isra-fel Thanks for your review, I have updated the PR. |
Added |
|
|
||
| The cmdlet may call below Microsoft Graph API according to input parameters: | ||
|
|
||
| - GET /servicePrincipals/{id} |
There was a problem hiding this comment.
Added in the help doc
|
/azp run azure-powershell - security-tools |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Description
Migrate Microsoft.Azure.Graph to MicrosoftGraph
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added