Reputation: 302
Is there a way to retrieve the certificate for an Azure Active Directory Service Principle after it has been created?
I have found how to create a Service Principle using PowerShell but haven't been able to find if it's possible to retrieve the cert from the portal, or by SDK or Script.
Upvotes: 1
Views: 2131
Reputation: 823
Use get-MsolServicePrincipalCredential from https://learn.microsoft.com/en-us/powershell/module/msonline/?view=azureadps-1.0
PS C:\Users\maweeras> Get-MsolServicePrincipalCredential -ObjectId $ServicePrincipalId.ObjectId -ReturnKeyValues $true
Type : Asymmetric
Value :
KeyId : 893295bf-f682-4682-a1d6-106508f41432
StartDate : 20/10/2016 21:56:16
EndDate : 20/10/2018 21:56:16
Usage : Sign
Type : Password
Value :
KeyId : 893295bf-f682-4682-a1d6-106508f41432
StartDate : 20/10/2016 21:56:16
EndDate : 20/10/2018 21:56:16
Usage : Sign
Type : Asymmetric
Value : MIIC8DCCAdigAwIBAgIQK<snipped for brevity>E/Ce59c7EJAEjbtvyXiwRLvy07SMZgLBbrpBSOc9f2RaSZlQEmzagNEoDZnXHRYCIVlD7DN7Xdf96iGja4
pwoZaRz6TW618EIQAh+jAuUcOxInGJErrHZjMjaFmWSsH
KeyId : 3ee9318e-b35a-48a8-b24c-5311d076e9e3
StartDate : 20/10/2016 21:56:16
EndDate : 20/10/2018 21:56:16
Usage : Verify
Type : Other
Value :
KeyId :
StartDate :
EndDate :
Usage :
Upvotes: 1