View SharePoint Service Principal

post

Overview

There are a few reasons you may want to dig further into a principal created through the AppRegNew.aspx page but most likely it will be to regenerate a secret. This post covers viewing the principal in Azure and then a simple cmd to regenerate the secret.

View in Azure

The one piece of information that you will definitely have for a SharePoint app registration is the Client ID, the first step of this process is to get the object ID which is required in the URL:

az ad sp list --filter "appId eq '00000000-0000-0000-0000-000000000000'"

This will the details of the Service Principal, the value required is the "id" which represents the ObjectId.

Using the URL below: https://portal.azure.com/#view/Microsoft_AAD_IAM/ManagedAppMenuBlade/~/Overview/objectId/00000000-0000-0000-0000-000000000000/appId/00000000-0000-0000-0000-000000000000/preferredSingleSignOnMode~/null

Replace the first empty GUID with the "id" from the Azure CLI query above and then the 2nd with Client ID of the SharePoint app registration.

Reset the Secret

Resetting the secret is simple using az ad sp credential reset, it is required to provide the "--id" parameter with the Client ID and then "--append" to add a new value rather than overwrite, this can be useful if creating a secret rotation approach.

Tim Hills

Tim Hills

Tim has been working in solution delivery for over 15 years and has really exceled in the industry. He has been fortunate enough to work with some high-profile clients and challenging projects which has positioned him well for turning business requirements into reality.

Registered office

Address: Arceau Solutions Ltd, Dane John Works, Gordon Rd, Canterbury, CT1 3PP

Telephone: 0208 191 7030