Grant service principal access to application in other tenant

前端 未结 3 1945
滥情空心
滥情空心 2021-01-14 00:29

I have an Azure AD service principal in one tenant (OneTenant) that I would like to give access to an application in another tenant (OtherTenant).<

3条回答
  •  心在旅途
    2021-01-14 00:36

    Ok, I finally got around to testing if the solution presented by Rohit Saigal works. It does point in the right direction but is not complete.

    First step is to create a service principal in OneTenant that represents the application in OtherTenant. So while signed in to OneTenant, run the following script:

    $spInOneTenant = New-AzureADServicePrincipal -AppId 
    

    Next step is to run the New-AzureADServiceAppRoleAssignment cmdlet with the following parameters:

    New-AzureADServiceAppRoleAssignment `
        -Id  `
        -ObjectId  `
        -PrincipalId  `
        -ResourceId $spInOneTenant.ObjectId
    

    The trick is to use the object id of the service principal you created in the previous step as the ResourceId.

提交回复
热议问题