question

AmandaCH-5867 avatar image
0 Votes"
AmandaCH-5867 asked ·

Login-AzureRmAccount -Credential $cred -TenantId "Tenant ID" command is failing with error AADSTS50034: The user account Microsoft.AzureAD.Telemetry.Diagnostics.PII does not exist.

I am following the steps mentioned in following article:
https://social.technet.microsoft.com/wiki/contents/articles/40062.azure-automating-login-for-powershell-scripts-using-service-principal.aspx

The Login-AzureRmAccount -Credential $cred -TenantId "Tenant ID" command is failing with error AADSTS50034: The user account Microsoft.AzureAD.Telemetry.Diagnostics.PII does not exist.

azure-active-directory
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

amanpreetsingh-msft avatar image
0 Votes"
amanpreetsingh-msft answered ·

@AmandaCH-5867 In this case, you are using $cred for application credentials. However, Azure AD is looking for a user account with those credentials. You need to add -ServicePrincipal switch to the command to instruct Azure AD to look for application rather than user account. Below is how the command should look:

Login-AzureRmAccount -ServicePrincipal -Credential $cred -TenantId "Tenant ID"


Please "mark as answer" or "vote as helpful" wherever the information provided helps you to help others in the community.




· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.