- Open Azure key vault and navigate to
Certificates
section. - Click on
Generate/Import
button to create a certificate.
- Fill the required details. Make sure
Method of Certificate Creation
is Generate and content type is PEM.
- Click on Current version of certificate.
- It will open a menu, click on
Download in PFX/PEM format
Once the download is completed open the downloaded certificate in notepad. The downloaded certificate must be in .pem format.
The certificate will contain bot the base64 string and private key
-
Copy the content between
-----BEGIN CERTIFICATE-----
and-----END CERTIFICATE-----
. This will be the value ofBase64EncodedCertificate
in appsettings.json file. -
Copy the content from
-----BEGIN PRIVATE KEY-----
and-----END PRIVATE KEY-----
. (Including theBEGIN
andEND
strings). Inside helper folder of this project create a new .pem file and paste the copied key. The key must contain-----BEGIN PRIVATE KEY-----
and-----END PRIVATE KEY-----
strings. -
The name of the file which stores the priavate key is the value of
PRIVATE_KEY_PATH
. The file must be present inside helper folder of this project.