Azure Active Directory API Get List - azure

Is there's an API to get all Tenant or Active Directory under your account?
Thanks!

You could use Tenants - List to get the tenants for your account. It's easy to click the green "Try it". Then you will get all the tenants ID for your account.

Related

How to get list of all Azure Tenants

When I login to Azure and list all subscriptions I see a list of 9 tenants (see pic).
via this url: https://portal.azure.com/#settings/directory
However when I use Get-AzTentant I only get 4?
How can I programmatically obtain a list of all 9 accessible Tenants?
Thanks.
Check if you have the access to all the tenants listed in your Azure Directory because the cmdlet Get-AzTenant returns the list of tenants if your account is authorized with those tenants as it is mentioned in this MS Doc.
I have given the access to only one tenant for one of the users and checked by logging with that user credentials:

How do you migrate trial content from Video Indexer to a Paid account?

I have a number of videos in my Video Indexer Trial account that I would like to move over to a Paid account. I tried following the instructions in https://learn.microsoft.com/en-us/azure/media-services/video-indexer/connect-to-azure#import-your-content-from-the-trial-account but this appears to only work if you setup your trial account with Azure AD.
Since I setup the Trial account with a Personal Microsoft Account, I don't see an option to import my existing content into a new account. I've setup everything manually in Azure for a new account (including Azure AD), but I don't want to lose the content from my Trial account.
Is there a way to import the Trial account content from Video Indexer into a paid account when your trial account was setup with a Personal Account? Thanks.
There is a way to import your media between different accounts, even if you are using two different authentication methods(Personal Microsoft Account/Gamil and Azure AD).
Use this link to learn how to invite your Azure AD user into your Personal Microsoft Account as a contributor and appoint yourself to be an owner in the account.
Then access your AAD account, choose the trail account you wish to move to be a paid account, click the 'create unlimited account' this time you should have the option to check the "import my media' checkbox.
Our recommendation is to follow the Prerequisites list section as described here
in order to make sure the user has all the correct permissions on the account.
Connecting to Azure can also be done with a manual Flow. This will require the user to be with either an Owner role, or both Contributor and User Access Administrator roles as described in this link

One login for multiple Azure subscriptions?

I have two azure subscriptions, one personal, tied to my Microsoft ID, and another under a different Microsoft ID for a charitable organization where I am the one-man IT/web dev guy. I created the org's azure account/subscription myself. I can't figure out how to create websites, etc. under my personal MS ID login without logging in and out of the separate microsoft IDs to manage both sets of Azure resources.
Logging in with the org's MS ID, in the azure portal I've made my personal ID a subscription admin (Subscriptions>Access Control>Add my personal MS ID, then right clicked to make co-administrator. This is confirmed since now a right click shows "Remove co-admin" so that implies it's correctly set up as a subscription co-admin. That user is also in the Owner Role.
Step 2, in the Active Directory for the org subscription, Users and Groups>All Users>New User, added my personal MS ID. Then I select that user, click Directory Role on the left menu, and selected Global Administrator radio button and save.
So now my personal MS ID user is a subscription co-admin and a AD Global admin in the org's azure portal.
To check, if I then go to any resource group or App Service and look at Access control I see my personal MS ID user listed as an Owner for that resource and all other resources. So everything looks good.
So if I log out of the org ID and log in with my personal MS ID and go to the Azure portal, I see my usual personal Azure account resources. But I don't understand how to either see and manage those resources in the org's Azure subscription or how to switch subscriptions, or switch directories (it's not listed on the top right), and when creating a new resource, I have no option for the org's subscription to use. How do I see/manage those resources in the org's directory? Is this even possible? Or do I need to log out and log in with the org's MS ID, which is a major annoyance since it also logs me out of outlook etc. when I switch IDs.
Azure Subscriptions are "housed" within a specific Azure Active Directory Tenant. You should treat an AAD Tenant as the top level object structure, in that each Tenant is entirely separated from each other Tenant.
If you had multiple subscriptions within a single tenant, you would be able to sign in one time, and gain access to all those subscriptions.
However, since these subscriptions look like they are in different Tenants, there is no way to avoid logging in two times to access the two subscriptions. To expand on this, there would be no way to avoid logging in two times to access any unique objects across these two Tenants.
For me, the answer was
Access Azure portal login page
Click "Sign in as a different user"
type the exact same email address
select "School or Work account" option.
This one was tied to the Azure AD and they reset my password through there. Not sure it really helps you cos signing in and out all the time still a thing, but it took me far too long to get this right so thought i'd share.

Don't have access in Azure Portal to create new items

I was added as a global administrator to a company's Azure AD directory. When I try to create a new web app I get the following message:
You are currently signed into the '-company- (Default Directory)' directory which does not have any subscriptions. You have other directories you can switch to or you can sign up for a new subscription.
When I try to sign up for a new subscription it wants me to enter my payment information, which I do not want to do. I want to use the company's existing subscription.
I also cannot see the App Service that the admin of the account just created in the portal.
It seems like I'm not fully configured, but we thought adding me as Global Administrator should give me exactly what he has, which is what we want. What else do we need to do so we have the same access, and can see each other's items?
In new Azure Portal, you should be added as a Co-Owner through the RBAC system. You should contact your Account Administrator(AA) who could grant the permission to your subscription. More information about how to add an admin for a subscription please refer to this article.
More information about RBAC please refer to this article.
You are the admin of the Azure AD directory, but not any subscriptions in that directory (assuming there are subscriptions). Directory admins don't have access to subscriptions by default. A subscription admin will need to grant you access to a subscription.
Note that directories can be created without subscriptions, so not every directory has an Azure subscription.
Also, a credit card is required to create a new subscription and you can't reference an existing company account without the company's Azure account admin doing that for you. Unfortunately, only one account can have access to do that today.

Confusion between work account & Microsoft account

I am using my work email address to set up multiple Azure IaaS environments. When I log into Azure, I get asked if I want to use the "Work or School Account" or "Personal Account" - both referring to the same email address.
I don't recall setting up anything in terms of personal accounts, or linking my work email as a Microsoft Outlook.com/Hotmail/etc account.
Access to the subscription has been applied to my Personal account, not the work one.
When granting access, there's no way to pick which one you're giving access to.
Couple of questions
I've created some VMs but want them to be linked to my work account. Can I change this?
How do I unlink my work email from Personal. I want to use work just for work, and not have any confusion between the two.
See this screengrab for more information:
There are few problem with your account so lets go over them one by one.
First means that now you have 2 different accounts one it is your work account another one it is your microsoft account. You can create both of them with the same email since they are from 2 different tenants.
This is a concept important or you to understand there is something on Azure that it is over the subscription that is the tenant
Tenant
|- Subscription
|- Resource Group
|- Resource
All subscription under the same tenant have the same Authentication method, this Authentication method can be linked to an Azure Active Directory ( Office 365 subscriptions are Azure Active Directory ) So you can open a request to microsoft to transfer your subscription to your company tenant. if you do this all the resources under it will be transferred to your other authentication. You can open this ticket on the portal.
If you don't want your personal account anymore you can close it on https://account.live.com/closeaccount.aspx
Thanks to those who edited the question for me, my line-breaks didn't work by default, I'll ensure that I get it write next time. I was only allowed to post the image as an attachment being first-time poster, someone fixed that for me.
The answer from Gabriel Monteiro Nepomuceno was correct and touched on the root cause, but there's one element I didn't include in my question.
Regarding the tenant: the tenant is created under the company account of "company.com". I am a sub-contractor and was granted access to my own account at "benscompany.com". Azure support have advised that its only possible to grant access to different account via the personal account.

Resources