Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Thank you for the very detailed write-up and for already performing thorough troubleshooting. Since the same “Keyset does not exist” error is reproducible directly from the Kudu PowerShell console, this confirms the issue is at the App Service platform level (the certificate object is present in CurrentUser\My, but the private-key container is not correctly attached to the worker).
Please try the following steps in order. These resolve the majority of this specific scenario:
1. Add / verify the critical app settings
Go to your App Service → Configuration → Application settings and ensure both of these are present:
WEBSITE_LOAD_CERTIFICATES = <your-certificate-thumbprint> (or * )
WEBSITE_LOAD_USER_PROFILE = 1
The second setting is frequently required for the private key to become accessible under the App Service identity. Save the changes.
2. Perform a full Stop → Wait → Start (not a Restart)
Click Stop on the App Service
Wait 4–5 minutes
Click Start
A simple Restart is often not sufficient to force a clean re-injection of the private-key container.
3. Verify the private key is now present
After the app has started, open the Kudu PowerShell console and run:
PowerShell
Get-ChildItem Cert:\CurrentUser\My |
HasPrivateKey must return True. If it does, test your application code again (GetRSAPrivateKey()).
4. If HasPrivateKey is still False
Delete the certificate from TLS/SSL settings → Private Key Certificates
Export a fresh PFX from a machine where you can confirm “You have a private key that corresponds to this certificate”
Re-upload the new PFX
Update WEBSITE_LOAD_CERTIFICATES if the thumbprint changed
Repeat the full Stop → Wait → Start cycle and re-check HasPrivateKey
5. Isolation test (if the issue persists)
Create a brand-new App Service (or a new App Service Plan) in the same region, upload the same PFX, set the two app settings above, and test.
If it works on the new plan → the original plan has a corrupted worker state (scale out/in or move the app).
If it fails on the new plan as well → please open a support ticket and include the region (East US) + approximate timestamps of the failures so the platform team can investigate the certificate injection pipeline.
These steps address the exact failure mode you are seeing (certificate visible, private key container missing). Please try steps 1–3 first and reply with the result of the HasPrivateKey check — we can then decide the next action quickly.
Official Microsoft documentation
- https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate?tabs=apex%2Crbac%2Cazure-cli
- https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate-in-code?tabs=windows
If the answer is helpful, please do click "Accept the answer” and Yes, this can be beneficial to other community members.