Azure App Registration
Last updated
Last updated
© Patch My PC 2024
Applies to: On-premises Publisher
This article covers integrating the Patch My PC Publisher with your Intune tenant. We will go over creating an app registration in your Azure AD environment and configuring the Graph API permissions required for the Publisher to automatically create, update and assign Win32 applications in your Intune tenant; as well as configuring the tenant authority, application ID and application secret within the Publisher.
Topics covered in this article:
In order for our service to have permissions to your Intune tenant for application management, start by navigating to your environment’s Azure AD portal, head to App registrations, and click New registration in the top left of the main pane.
Give your app registration a relevant name such as “Patch My PC – Intune Connector”. Configure the account types based on your tenant requirements. For the Redirect URI, leave it to the default unless you have specific requirements for configuring the Redirect URI. Then click Register.
A full Intune API reference KB article for the Publisher can be found at https://patchmypc.com/patchmypc-publisher-api-reference
After you register a new application, we will need to delegate certain permissions in order for the Patch My PC Publisher to create and update Win32 applications in your Intune tenant, as well as view Azure groups and create assignments for the applications automatically.
Once the new app is registered, navigate to the API permissions node in the left column of the newly created app’s page. In the API permissions page, click the button to Add a permission, then in the right pane that appears, select the Microsoft Graph API.
Then, you are prompted for what type of permissions your app requires select Application permissions. In the Select permissions table view, search for “DeviceManagement” and under those permissions, enable the following:
DeviceManagementApps.ReadWrite.All
(View and create applications in Intune)
DeviceManagementConfiguration.Read.All
(View properties and relationships of assignment filters)
NOTE: The DeviceManagementConfiguration.Read.All permission is not needed if you are on the deprecated Intune Essentials subscription.
DeviceManagementManagedDevices.Read.All
(View device inventory for the auto-publish feature)
DeviceManagementRBAC.Read.All
(View scopes to be assigned to applications)
DeviceManagementServiceConfig.ReadWrite.All
(Update Enrollment Status Page configurations)
Then, search for “GroupMember”, and under Group permissions, enable:
GroupMember.Read.All
View Azure AD groups to enable automatic application deployment
Click Add permissions.
To approve the new permissions, click Grant admin consent for. Choose Yes if you are prompted to consent for the required permissions. You must be logged into an Azure AD account with permissions to perform this task.
Note: Granting admin consent may require one of the following roles: Global Administrator or Privileged Role Administrator.
The result is shown below.
A certificate is considered more secure than a client secret for authentication to the new app registration as it is something you have (private key) rather than something you know (password). A client secret is the easiest configuration method but is considered less secure.
More guidance on why a certificate should be used instead of a client secret can be found at https://learn.microsoft.com/en-us/azure/active-directory/develop/security-best-practices-for-app-registration#certificates-and-secrets
Choose either Option 1 or Option 2 from the steps below to create an authentication credential for use with the new app registration. We strongly recommend using Option 1.
Certificate-based authentication is the preferred authentication method when connecting to an Azure App Registration. This document will focus on creating a self-signed certificates for use with the Patch My PC Publisher: Create a self-signed public certificate to authenticate your application.
Self-signed certificates with long expiry dates may use outdated hash and cipher suites that may not be strong enough as industry standards and best practices change. For this reason, choose short expiry dates or purchase a certificate signed by a well-known certificate authority.
The following are the current requirements for using certificate-based authentication that apply to both purchased and self-signed certificates:-
A 2048-bit key length. While longer values are supported, the 2048-bit size is highly recommended for the best combination of security and performance.
Uses the RSA cryptographic algorithm. Azure AD currently supports only RSA.
The certificate is signed with the SHA256 hash algorithm (Entra ID also supports certificates signed with SHA384 and SHA512 hash algorithms).
The certificate is valid for only one year.
Follow the steps below to create a self-signed certificate using the New-SelfSignedCertificate and Export-Certificate PowerShell cmdlets:-
Open a PowerShell window on the same computer where the Patch My PC Publisher is installed. Be sure to elevate the prompt by choosing Run as Administrator.
Copy the following code snippet to and paste into the elevated PowerShell window.
Verify the certificate was created successfully in the Local Machine Personal Certificate Store by running certlm.msc.
We need to export the Public Key and upload it to the new app registration for the Patch My PC Intune connector. Follow the steps below:-
Open PowerShell window on the same computer where the Patch My PC Publisher is installed. Be sure to elevate the prompt by choosing Run as Administrator.
Copy the following code snippet to and paste into the elevated PowerShell window.
Verify the certificate was exported successfully in the C:\temp\certs folder.
If you receive the message "The system cannot find the path specified" (as shown below), please ensure the credentials used to launch the PowerShell session have permission to create a folder at C:\temp or specify a new path for the $certFolder variable where you do have permission to create the folder.
In the browser, navigate to the App registration created in Step 1 and select the Certificates & secrets node in the left column. Select the Certificates and click Upload certificate.
Browse to the C:\temp\certs folder, select the certificate that was exported earlier, click Open and then click Add.
Verify the public key is listed correctly in the app registration.
If you have already followed the instructions for Option 1, you do not need to create a client secret. Instead, go to Step 4
A client secret, a password string that our app will use to prove its identity when requesting a token. Navigate to the Certificates & secrets node in the left column, and click the button to add a New client secret. Decide on a description and expiration date (in months) that best suits your organization’s needs, then click Add.
Microsoft recommends a client secret of no longer than 6 months
Copy the Value for the Client Secret you created. Save this value to a secure location, you will enter the value under Application Secret in the Intune Options of the Publisher.
You may receive an error similar to ‘An error occurred while connecting to Intune: AADSTS7000215: Invalid client secret is provided.’ within the PatchMyPC.log file. If you receive this error please repeat option 2 above to create a new secret, or review your existing secret configuration within the Publisher to ensure you are using the correct value.
Navigate to the Overview node of the app registration, and copy the Application (client) ID. Save this value to a secure location along with your secret key value.
If you do not know your Intune tenant domain, navigate to the tenant status page in your Intune tenant, and look at the property for Tenant name.
Now, it is time to go to the Intune Options window of the Publisher Patch My PC Publisher to configure the following:-
Authority Application ID Certificate or Application Secret (depending on whether you followed Step 3 option 1 or option 2)
The Authority value is a URL made up from the Microsoft authentication endpoint and your tenant name. The newer Microsoft authentication endpoint should be used:- https://login.microsoftonline.com
Referring to the screenshot above, replace tenantname.onmicrosoft.com with the Tenant name you found in the tenant status page of your Intune tenant. The construct of the URL should look something like https://login.microsoftonline.com/<<Tenant name>> The complete Authority value should look similar to this example below:- https://login.microsoftonline.com/tenantname.onmicrosoft.com
Paste the Application ID that you recorded earlier.
If you chose to use a Certificate for authentication, click the certificate option and browse the Local Machine store for the correct certificate and click Ok.
If you chose to use a Client Secret for authentication, click the Application Secret option and enter the Client Secret value you recorded earlier.
Click Test to view the Intune Connection Status and validate that the Publisher can connect to your Intune tenant. If the listed permissions all have a green checkmark under Enabled, you can now begin to publish applications to your Intune tenant.
If the associated tenant is on GCC High, the changes below are required: Authority: https://login.microsoftonline.us Authentication URL: https://graph.microsoft.us Graph Base URL: https://graph.microsoft.us/beta