AZURE – resolving error – Connect-AzAccount : UsernamePasswordCredential authentication failed: ROPC does not support MSA accounts – while using personal account to connect AZURE

Hi All,
Greetings for the day!!!
Today new issue and solution 🙂
Background
- I was creating Microsoft Purview account using PowerShell
- So to create Microsoft Purview account I need to connect to Microsoft Azure
- For connecting Microsoft Azure I am using Connect-AzAccount POWERSHELL CMDLET
- I am connecting to AZURE through my personal hotmail account, please note that account is not an organizational account
- So my code to connect Azure is as
$Credential = Get-Credential
Connect-AzAccount -Tenant 'f5e04f02-2b57-4dc7-b3b6-b7644bf07ec7' -SubscriptionId '90a7a7b3-694b-4e45-a8ec-2a116f45a08d' -Credential $Credential
- While executing above code I am getting an error
Error / Issue
PS C:> C:\Prasham\Articles\PowerShell\Ms Purview Acc\createmspurviewaccount.ps1
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
WARNING: Unable to acquire token for tenant ‘organizations’ with error ‘UsernamePasswordCredential authentication failed: ROPC does not support MSA acco
unts. See https://aka.ms/msal-net-ropc for details. ‘
Connect-AzAccount : UsernamePasswordCredential authentication failed: ROPC does not support MSA accounts. See https://aka.ms/msal-net-ropc for details.
At C:\Prasham\Articles\PowerShell\Ms Purview Acc\createmspurviewaccount.ps1:2 char:1
- Connect-AzAccount -Credential $Credential
~~~~~~~~~- CategoryInfo : CloseError: (:) [Connect-AzAccount], AuthenticationFailedException
- FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand

Solution
- This is known issue. This error comes while connecting to AZURE, when we use our personal account
- We need to use the organizational account to connect AZURE
- So what I did, I added my organizational account to subscription
- And then connected with AZURE with organizational account
- In below section there are detailed steps to add an account to subscription (adding my organizational account to subscription)
Adding an account to subscription – how to add an account to subscription / assigning role
- Login to AZURE portal
- From the Azure services – click on “Subscriptions“
- We will be navigating to subscription blade – https://portal.azure.com/#view/Microsoft_Azure_Billing/SubscriptionsBlade
- Here I have only one subscription – “Free Trial” as in above figure
- Click on subscription – “Free Trial“, we will be redirected to subscription overview page
- From left blade click on “Access control (IAM)” link
- We will be redirected to “users” blade as
- From users blade click on – “Add role assignment” button as highlighted in above figure
- We will be redirected to “Add role assignment” page (AddRoleAssignmentsLandingBlade) as
- Select the role which we want to assign to subscription
- As we select the role, click on “Members” tab as
- Click on “+ Select members” link to select the members, “Select members” right pane will open as
- Search or select the user which we want to add
- Here I am adding user from my organizational account
- Once role is assigned successfully, user will be listed under “Role assignments” tab as
Thanks for reading!!! HAVE A GREAT LEARNING AHEAD!!
You must log in to post a comment.