When using a Microsoft Dynamics 365 Azure cloud-hosted environment, you may receive an error message relating to a D365 invalid certificate. In this article, I will describe the steps required to resolve this error. Certificates are used to secure communications over the Internet. They expire after a specific period and need to be renewed. Therefore, if you have had a cloud-hosted environment running for some time, you may experience this error at some point.
Debug Error
First, if your certificate is no longer valid, when you click the Start button in Visual Studio, you will see this error.


The error message reads: “Unable to proceed with debugging. One ore more errors occurred. See the exception details below for more information. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.”
Browser Error
Second, if you try to access Microsoft Dynamics 365 for Finance and Operations from a browser, you will also receive an error. In a browser, navigate to the D365 URL. If your certificate has expired you will see a D365 invalid certificate error.


The error reads: “Your connection is not private. NET::ERR_CERT_DATE_INVALID”.
In this case, this is because the certificate in the Azure cloud-hosted environment has expired. To fix the issue, we need to renew the SSL certificate.
Rotate Secrets In LCS
To fix the D365 invalid certificate error, first navigate to lcs.dynamics.com in a browser. Life Cycle Services (LCS) is the primary site for administering Azure cloud-hosted environments.
First, in LCS, click on the three lines button, then Cloud-hosted environments.

Second, select the cloud-hosted environment from the grid, then click ‘Full details‘.

Third, on the main environment page, click on Maintain>Rotate secrets.

Fourth, click the ‘Rotate SSL certificates’ button in the dialog that pops up.

Fifth, wait several minutes for the certificates to be updated. This should resolve the D365 invalid certificate error.
Finally, try reloading the browser that is navigated to the D365 environment. You will no longer see the error.

Microsoft Documentation
To learn more about SSL certificates and their importance, please visit this link.
Conclusion
The certificates on Azure cloud-hosted environments can expire from time to time. Fortunately, they are easy to refresh without needing to write and run scripts. Simply use LCS to rotate the certificates for you.
Leave a Reply