This document describes the steps to create a custom eSHARE Tenant Scan application in the Microsoft Entra (Azure AD) portal. The following steps will be reviewed:
PREREQUISITES:
The person performing these steps must have an administrator role assignment of Application Administrator, Cloud Application Administrator, or Global Administrator in the destination M365 tenant.
Register the Application
Sign in to the Microsoft Entra admin center (https://entra.microsoft.com or https://entra.microsoft.us) and navigate to 'Applications' > 'App Registrations'.
On the 'App Registrations' page, click the '+ New registration' button in the top menu bar.
Enter a recognizable, unique name for the custom eSHARE Tenant Scan app and select the 'Register' button at the bottom of the page. In a few moments, a shell application is created and ready for further configuration.
Modify the Application Manifest - Commercial Cloud
On the newly registered application page, navigate to the 'Manage' > 'Manifest' tab.
In the application's manifest, look for 'requiredResourceAccess'.

Replace the above string (including the comma at the end) from line 53 to 63 with the text below.
"requiredResourceAccess": [
{
"resourceAppId": "c5393580-f805-4401-95e8-94b7a6ef2fc2",
"resourceAccess": [
{
"id": "594c1fb6-4f81-4475-ae41-0c394909246c",
"type": "Role"
},
{
"id": "4807a72c-ad38-4250-94c9-4eabfe26cd55",
"type": "Role"
}
]
},
{
"resourceAppId": "00000003-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "5e1e9171-754d-478c-812c-f1755a9a4c2d",
"type": "Role"
},
{
"id": "98830695-27a2-44f7-8c18-0c3ebc9698f6",
"type": "Role"
},
{
"id": "19da66cb-0fb0-4390-b071-ebc76a349482",
"type": "Role"
},
{
"id": "332a536c-c7ef-4017-ab91-336970924f0d",
"type": "Role"
},
{
"id": "df021288-bdef-4463-88db-98f22de89214",
"type": "Role"
}
]
}
],Click the 'Save' button in the top menu bar.
Modify the Application Manifest - Government Cloud
On the newly registered application page, navigate to the 'Manage' > 'Manifest' tab.
In the application's manifest, look for 'requiredResourceAccess'.

Replace the above string (including the comma at the end) from line 42 to 52 with the text below.
"requiredResourceAccess": [
{
"resourceAppId": "c5393580-f805-4401-95e8-94b7a6ef2fc2",
"resourceAccess": [
{
"id": "594c1fb6-4f81-4475-ae41-0c394909246c",
"type": "Role"
},
{
"id": "4807a72c-ad38-4250-94c9-4eabfe26cd55",
"type": "Role"
}
]
},
{
"resourceAppId": "00000003-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "5e1e9171-754d-478c-812c-f1755a9a4c2d",
"type": "Role"
},
{
"id": "98830695-27a2-44f7-8c18-0c3ebc9698f6",
"type": "Role"
},
{
"id": "19da66cb-0fb0-4390-b071-ebc76a349482",
"type": "Role"
},
{
"id": "332a536c-c7ef-4017-ab91-336970924f0d",
"type": "Role"
},
{
"id": "df021288-bdef-4463-88db-98f22de89214",
"type": "Role"
}
]
}
],Click the 'Save' button in the top menu bar.
Grant Admin Consent for API Permissions
REQUIREMENT:
Granting admin consent for permissions within an app registration must be performed by a Global Administrator in the destination M365 tenant.
For the saved application, navigate to the 'Manage' > 'API permissions' tab.
Select 'Grant admin consent for <tenant name>' at the top of the API permissions table.
Confirm when prompted.

Upload the Application Certificate
Obtain a certificate using one of the following options:
Option 1: Purchase a certificate from a well-known certificate authority and extract the private and public portions of the certificate. Upload the public portion in the Azure portal for the application and upload the private key in your eSHARE Admin Console (or provide the private key to your eSHARE admin).
Option 2: Create a self-signed certificate by following the instructions available at https://learn.microsoft.com/en-us/azure/active-directory/develop/howto-create-self-signed-certificate. A short summary of those instructions is below.
# Create a self-signed certificate in PowerShell
$mycert = "eShareApp"
$mycert = New-SelfSignedCertificate -DnsName "eShareApp" -Subject "CN=eShareApp" -CertStoreLocation "Cert:\CurrentUser\My" -NotAfter (Get-Date).AddYears(50) -KeyExportPolicy Exportable -KeySpec Signature -KeyLength 2048 -KeyAlgorithm RSA -HashAlgorithm SHA256# Extract .key file using OpenSSL
openssl pkcs12 -in eShareApp.pfx -nocerts -nodes -out eShareApp.key# Extract crt from pfx using OpenSSL
openssl pkcs12 -in eShareApp.pfx -clcerts -nokeys -out eShareApp.crt# Export certificate to .pfx file
$mycert | Export-PfxCertificate -FilePath eShareApp.pfx -Password $(ConvertTo-SecureString -String "myp@55W0rd" -AsPlainText -Force)When the appropriate certificate portions are available, navigate to 'Manage' > 'Certificates & secrets'.
On the 'Certificates' tab, click the 'Upload certificate' button.
Upload the CRT file from the steps above and click 'Add' at the bottom of the open pane.
Collect the Values Required for eSHARE Tenant Scan
Collect and save the following values:
M365 Tenant ID: Navigate to the 'Identity' > 'Overview' tab of the Entra admin center, copy the 'Tenant ID' and save it.
Application ID: Navigate to the 'Overview' tab of the application, copy the 'Application (client) ID' and save it.
Certificate Thumbprint: For the certificate used during the application registration process, copy the certificate thumbprint and save it.
Private Key: The private key (.key file from the steps above) for the certificate uploaded in the Entra portal for the application registration.
Please provide this information to your eSHARE Customer Success Manager to finalize the configuration.