APPS GALLERY

Power Automate Dataverse Client Certificate Auth Connection

Step-by-step guide to create app registration and certificates used in Dataverse connection that uses the Client Certificate Auth type.

Dataverse connection in Power Automate now supports certificate authentication with an App Registration. This is a guide to create an app registration in Microsoft Entra ID and generate certificates being used in Dataverse connection.

Create App Registration

Login to portal.azure.com and go to Microsoft Entra ID.

Open App registrations

In the left hand side pane, click App registrations.

App registrations menu in Microsoft Entra ID

Create a new registration

Click the New registration button in the right hand side pane. The following screen will show up. Enter a name for the app registration and click Register.

Register a new application screen

Open API permissions

Once it is created, the app registration page will open. Navigate to API Permissions.

API permissions tab on the app registration page

Add the required Application permissions

Click Add a permission in the right hand side pane to add the required Delegated permission:

  • user_impersonation

Dynamics CRM delegated permissions

Click Add permissions to complete this step.

Generate Certificate

Use the PowerShell script below to generate a .cer certificate file.

$cert = New-SelfSignedCertificate -Subject "CN=PowerAutomateDataverseCert" `
    -CertStoreLocation "Cert:\CurrentUser\My" `
    -KeySpec Signature `
    -NotAfter (Get-Date).AddYears(99)

Export-Certificate -Cert $cert -FilePath "<your local path>\PowerAutomateDataverseCert.cer"

The second line of the script saves the .cer file to your local file system. Browse to that folder to confirm you can see the .cer file.

Open Manage user certificates

Click the Start menu of your Windows machine and search for "Manage user certificates".

Searching for Manage user certificates from the Start menu

Export the private key (.pfx)

Locate the certificate you created and export the private key (.pfx) file to your local disk.

Exporting the certificate private key

Selecting the option to include the private key in the export

Choosing the export file format for the certificate

Set a password

Note: You need to enter a password on the screen below. Keep note of the password — you will need to supply it when setting up the connection later.

Entering a password to protect the exported .pfx file

Then save the .pfx file to your local file system.

You should now have two certificate files:

  • The .cer file — uploaded against the app registration.
  • The .pfx file — uploaded into D365.

Upload .cer to App Registration

Go to the Azure portal and locate the app registration you created in the previous step.

Open Certificates & secrets

Click on Certificates & secrets, and locate the Certificates tab in the right hand side pane.

Certificates and secrets section of the app registration

Click Upload certificate and select the .cer file from your local file system. Once successfully uploaded, you should see the certificate in the list.

Capture the Client Id and Tenant Id

Now go back to the Overview page of this app registration. Take note of the Client Id and Tenant Id as shown below — you will need them to complete the connection setup in D365.

Client Id and Tenant Id on the app registration overview page

Create Dataverse Connection

Go to https://make.powerapps.com/ and select the correct Environment where you want to create the connection.

New Connection

Navigate to Connections in the left navigation pane, and then click Add New Connection.

Add New Connection

Search for Dataverse and select the latest Dataverse connection from the list.

Add Dataverse Connection

Configuration

A screen will popup to configure Dataverse connection.

Dataverse Connection Configuration

Make sure you select Client Certificate Auth as the Authentication Type.

Enter Tenant Id and Client Id.

Upload the .pfx certificate file and enter the password, which is the one you entered when exporting the private key.

Click Create button to finish the setup.

Create Application User

The above steps created the app registration, public and private certificates used for authentication with Dataverse. This last step is to add the app registration (client id) as the application user in Dataverse and assign the appropriate security roles.

Follow this MS article to create the application user: https://learn.microsoft.com/en-us/power-platform/admin/manage-application-users#create-an-application-user

?

Need more help?

Reach out via the Contact Us page and we'll get back to you.