Question:Can someone explain to me why am I getting the following error when trying to connect Microsoft Identity to my Azure account to enable Azure AD authentication in my web app?
Answer:This error commonly occurs when Visual Studio or your method of authentication to your Azure subscription was done with a Microsoft Account and not an Azure Active Directory account.
If it is something like email@example.com, Please try to add this identity in the office 365 subscribed azure active directory account as a new guest user by
creating a user identityby filling name matching your Hotmail account and creating a password .So that identity is created as firstname.lastname@example.org.
The user must be recognized as a subscription owner.For that go to subscription properties by searching for Subscriptions . If you have multiple subscriptions, please make sure to select the one you intend to use for your application. Once in the subscription properties, select the Access control (IAM) option > Role assignments > Add.
- In the Add role assignment blade, select
Ownerfrom the Role drop-down list. Leave the Assign access to option at its default (User, group, or service principal). You’ll see all of the users listed. Select the newly created one and then save.
- Then sign out of aad account , save and close visual studio . Now Sign into azure ad account with this newly created identity and then try to add/Connect this identity in visual studio Microsoft identity platform.
In place of 2nd step from Azure,you can create a Free or Pay as you Go account using your Outlook.com email address (such as email@example.com) or firstname.lastname@example.org.
This creates an Azure subscription with a new Azure Active Directory and your account as the first user. It forms the new directory’s default domain name (personaloutlook.onmicrosoft.com) and you can add a custom domain name next similar to personal microsoft account if needed .
And then continue from step 3 to create owner role or admin to connect.
- Using Azure Active Directory Accounts with a Subscription Tied to a Personal (aka Live) Account | The Data Farm
- difference between a personal Microsoft account and a work or school account? – Microsoft Tech Community
- Connected services – Visual Studio (Windows) | Microsoft Docs
If you have better answer, please add a comment about this, thank you!