Home > Appendices > Appendix D - How to Prepare Certificates for the Custom Azure App
Download this articleThis section details how to prepare certificate files (.cer file and .pfx file). The .cer file can be used to create custom apps in Azure, and the .pfx file can be used when you Create an App Profile in Custom Mode in AvePoint Online Services.
To prepare self-signed certificate files based on your scenario, choose one of the following methods.
Before preparing a certificate with this method, make sure you have a key vault in Azure. If you do not have any key vaults, refer to the instructions below to create a key vault. Then, you can continue to prepare the certificates.
Make sure you have an Azure subscription that contains Azure Key Vault.
Create a key vault.
In Azure Portal, enter Key vaults in the search box on the top, and then select the first result to access the Key vaults page.
Click Create. The Create a key vault page appears.
In the Basics tab, provide the basic information for the key vault, and then click the Access configuration tab.
In the Permission model section, select Vault access policy.
In the Access policies section, click Create.
The Create an access policy pane appears. In the Secret permissions field, select Get.
Click Next to go to the Principal tab.
In the Principal pane, enter the application name or application ID in the search box.
Select the application and click Next to go to the Application (optional) tab.
In the Application (optional) pane, configure the settings based on your requirements and click Next to proceed.
In the Review + create tab, review all of your configurations first, and then click Create to create the access policy. You will be redirected to the Create a key vault page.
Click Next to go to the Networking tab.
In the Networking pane, select All networks in the Public Access section.
Click Next to go to the Tags tab.
In the Tags pane, you can add tags to categorize your key vault.
Click Review + create to review all of your configurations first, and then click Create at the bottom to create the key vault.
If you need to change some settings before creating the key vault, you can click the Previous button to change previous settings.
Generate a certificate from the key vault.
On the Key vaults page, select the key vault that you want to generate a certificate from.
Select Certificates > Generate/Import.

On the Create a certificate page, complete the required information, and then click Create to create the certificate.

In the Certificates list, select the newly created certificate.
Copy the secret identifier for later use.
Click the name of the certificate, and then select the current version of the certificate.
Click Download in CER format and Download in PFX/PEM format to download the certificate files to your local machine.
When you have the certificate (.pfx file), you must set a password to protect the certificate.
Open Windows PowerShell and paste the following script to Windows PowerShell. Replace [Full Path of your pfx certificate file] with the full path of the certificate (.pfx file) in your local machine.
Press Enter to execute the script.
The certificate needs to be uploaded to the Azure AD app that is used to connect AvePoint Portal Manager with your Microsoft 365 tenant.
To create the certificates via Internet Information Services (IIS) Manager, complete the following steps:
Go to Administrative Tools > Internet Information Services (IIS) Manager.
Click the server name in the Connections pane and double-click Server Certificates in the right pane.

Click Create Self-Signed Certificate in the Actions pane.
Enter a name for the certificate and click OK. The certificate will be listed in the Server Certificates pane.

Double-click the created certificate and click the Details tab. Click Copy to File to export the certificate.

In the Certificate Export Wizard window, click Next.
Select the certificate type.

To export a PFX certificate with a private key, select the Yes, export the private key option.
To export a CER certificate, select the No, do not export the private key option.
Click Next. Keep the default option on the page, and click Next.
If you select to export the private key, you need to enter the password for the certificate and confirm the password. Remember this password, and it will be used when creating the app profile.
Enter a name for the certificate file. You can also click Browse to specify the location where you want to save the certificate.

Click Next. The certificate information will be displayed.
Click Finish. The certificate file will be exported.
To create a self-signed certificate using Windows PowerShell, refer to the following steps:
The steps below are based on running Windows PowerShell on a machine with the Windows 10 operating system.
Right-click Windows PowerShell on the machine, and select Run as administrator from the drop-down list.
Refer to the following example to use the New-SelfSignedCertificate cmdlet. To customize the DnsName parameter, replace the string www.contoso.com with your DNS name.
Press Enter on the keyboard.
Refer to the following example to convert your password for the PFX certificate to secure strings. Replace P@ssW0rD! with the plain text string of your password. You must remember this password as it will be used when creating a custom Azure app.
Press Enter on the keyboard.
Enter the following command, and press Enter on the keyboard.
Enter the following command, and press Enter on the keyboard.
Enter the following command and replace c:\user.pfx with the full path of the PFX certificate file you want to create. Press Enter on the keyboard.
Enter the following command and replace c:\user.cer with the full path of the CER certificate file you want to create. Press Enter on the keyboard.