Search code examples
azureazure-active-directorymulti-tenantazure-app-registration

Is it possible to manipulate tenant from another tenant in Azure?


I am new to Azure, and one question bothers me.   Is it possible to create a multi-tenant logic in Azure with one "General" AAD that contains function apps and other tenants (more than 20) that should use these apps to manipulate their own tenants?

For example, there is an app for managing users (UserManagement). When this function is "called" from another tenant (Tenant "B"), let's say for adding a new user, it should add the user only in the called AAD (Tenant "B").

I try to accomplish this by storing app registration credentials in a table or service principal - app registration logic, but it has no effect. 

Thank you .


Solution

  • I did a test in my side with Azure AD Multi-tenant application with an asp.net core application, the feature is allowing users from different tenant to sign in then using Microsoft Graph API to query all the users.

    My Azure AD application is registered in tenant A which is a multi-tenant application. Then I used user in tenant B to sign in the application, then the query result is that all the users in tenant B is listed in the query result.

    Here's the sample I followed. And in the contoller, my request is like this: var users = await _graphServiceClient.Users.Request().GetAsync();

    Do not forget to set the tenant id as common for enabling the multi-tenant feature.

    enter image description here