Azure – Certificate error preventing remote desktop to Azure cloud service: ‘The certificate does not have a private key.’

azurecertificateremote desktop

I've inherited an cloud service that runs on Azure. I'd like to be able to remote desktop onto that service to make small changes. I want to set this all up via the Azure Portal (i.e. not using Visual Studio or other installed tools).

My understanding is that it's possible to do as there's an article written about it.

According to the instructions in that article, setting up remote desktop requires a certificate. The certificate that "came with" the service expired years ago. I am having issues creating a new one that works.

I followed instructions here and at other places (which I cannot link due to reputation) to create .cer and .pfx files with tools like makecert.exe and powershell. I uploaded both to the cloud service.

When I try to set up the remote desktop credentials using this certificate, I get the following error:

Failed to save Remote Desktop settings for deployment slot 'XXXXX'.
Error: The operation 'd92d37ce80b93b61bcd4117c5382bb2d' failed: 'The
certificate does not have a private key.'. The operation
'4322a36b8ebc3fafb7de91cbcbb67973' failed: 'The certificate does not
have a private key.'.

I'm guessing I created the .pfx and/or .cer files wrong? Searching for the error The certificate does not have a private key (in the context of Azure or just generally) did not turn up much that would help me.

How can I create a .pfx and/or .cer file that will have a private key, and will allow me to create remote desktop credentials? My development machine is Windows, so any tools would need to run on that.

Best Answer

The PFX file contains the private key. Actually, the PFX is the filename extension for PKCS#12.

The CER file only contains the public key. You only need to upload the pfx file.