BenV
BenV

Reputation: 12452

Azure Service Principal - Account Disabled?

I'm having trouble authenticating to Azure Resource Manager with a service principal. In the course of troubleshooting I noticed that Get-AzureADServicePrincipal shows AccountEnabled: False for my service principal, while Get-MsolServicePrincipal shows AccountEnabled: True for the same service principal.

C:\Users\virklba> Get-AzureADServicePrincipal -SearchString azuremaint |fl

ServicePrincipalName : https://mycompany.com/AzureMaint
ApplicationId        : 20bc779d-0edb-4a00-becf-952fda93edc5
AccountEnabled       : False <-----------
DisplayName          : AzureMaint
Id                   : 585cd6c7-403a-4940-9817-5139a254245e
Type                 :

C:\Users\virklba> Get-MsolServicePrincipal -ObjectId 585cd6c7-403a-4940-9817-5139a254245e

ExtensionData         : System.Runtime.Serialization.ExtensionDataObject
AccountEnabled        : True <-----------
Addresses             : {Microsoft.Online.Administration.RedirectUri, Microsoft.Online.Administration.RedirectUri}
AppPrincipalId        : 20bc779d-0edb-4a00-becf-952fda93edc5
DisplayName           : AzureMaint
ObjectId              : 585cd6c7-403a-4940-9817-5139a254245e
ServicePrincipalNames : {https://mycompany.com/AzureMaint, 20bc779d-0edb-4a00-becf-952fda93edc5}
TrustedForDelegation  : False

I tried doing Set-MsolServicePrincipal -ObjectId 585cd6c7-403a-4940-9817-5139a254245e -AccountEnabled $true, but that didn't change anything. There is no Set-AzureADServicePrincipal cmdlet.
So how do I make sure the account is really enabled?

Upvotes: 0

Views: 2750

Answers (1)

BenV
BenV

Reputation: 12452

Confirmed with MS that this is a bug in the PS module. Also, I documented my "service principal in Azure Automation" issue here (ended up being another PS bug).

Upvotes: 1

Related Questions