0

I have a Microsoft account. I have a subscription which belongs to, say, tenant1 (AD1). I create another active directory (say, AD2), but I don't move the current subscription to AD2.

I can create users in both active directories, make them guests for each other and login to my web api application.

Now I want to know all the tenants related to a logged in user.

For example user1 is a member of AD1, and a guest of AD2, AD3. My web api is registered in AD1.

I call https://management.azure.com/tenants?api-version=2019-06-01 but it retrieves only ID of AD1, but I expected to have an array of AD1, AD2, AD3.

What am I doing wrong?

amplifier
  • 1,793
  • 1
  • 21
  • 55

1 Answers1

0

After adding a new guest user, the guest user will receive an email, the guest user must accept it from that email.

If you haven't accept it, the source will be Invited user. And you will not get this tenant information when you call list tenants api. enter image description here

After accepting it, the source will change. Now you will be able to get this tenant in the list.

enter image description here

update: Can you see the tenants on azure portal?

enter image description here

Tony Ju
  • 14,891
  • 3
  • 17
  • 31
  • I did accept invitations, I'm able to login with guest user as well. – amplifier Oct 01 '19 at 10:36
  • @amplifier Are you able to see the tenants the user belong to on Azure portal? See the screenshot in my answer. – Tony Ju Oct 08 '19 at 06:36
  • Yes I am. I see all the tenants created. – amplifier Oct 09 '19 at 08:35
  • @amplifier If so, I am afraid that you need to raise a support ticket on azure portal by following this link: https://learn.microsoft.com/en-us/azure/azure-supportability/how-to-create-azure-support-request – Tony Ju Oct 09 '19 at 08:37