Hello @Sami Inkinen,
To ensure your Azure App Service works properly with MongoDB Atlas, which now requires GTS Root R1 and GTS Root R2, follow these steps:
Check if GTS Root R1 and R2 are Already Trusted
Azure App Service maintains a list of trusted root certificates. You need to check if GTS Root R1 and GTS Root R2 are included.
For Windows-based App Services:
Open Kudu In the Azure Portal, go to your App Service.
- Under Development Tools, click Advanced Tools → Go.
Open the PowerShell console and run:
dir cert:\localmachine\root
Look for GTS Root R1 and GTS Root R2 in the output.
For Linux-based App Services:
- Open SSH in Kudu and Run:
cd /etc/ssl/certs ls | grep GTS
- If GTS Root R1 and GTS Root R2 appear, you’re good to go.
Adding GTS Root Certificates (If Not Present)
If they are missing, follow these steps based on your App Service type:
For Multi-Tenant App Services (Free, Basic, Standard, Premium Plans):
- You cannot manually modify the root certificate store.
- Check with Azure Support to confirm if GTS certificates will be added automatically.
- If your app fails TLS validation, consider switching to an App Service Environment (ASE).
For App Service Environment (ASE) :
- Download GTS Root R1 and GTS Root R2 as
.CER
files (Base64-encoded) . - In Azure Portal, go to your App Service under TLS/SSL settings > Private Key Certificates (.pfx).
- Click Upload Certificate, and upload both GTS root certificates.
- Add this setting in Application Settings and Restart the App Service :
WEBSITE_LOAD_ROOT_CERTIFICATES = <Thumbprint_of_GTS_Root_R1>,<Thumbprint_of_GTS_Root_R2>
If your App Service has been working fine with Let's Encrypt, it means the necessary Let's Encrypt certificates were already trusted by default.
- You might not have explicitly configured Let's Encrypt since MongoDB Atlas ensures its certificates are valid.
- If GTS Root R1 and R2 are required, they should be available in the trusted store. Check first if GTS Root R1 and R2 are already trusted. If not, contact Azure Support for multi-tenant plans and manually upload the certificates and configure
WEBSITE_LOAD_ROOT_CERTIFICATES
.
For more details, see Azure’s Root CA Guide.
Hope this helps!
If you found this answer helpful, please click Accept Answer and kindly upvote it.
If you have any further questions, please click Comment.