Certificates and the App Service Environment
This article is about the App Service Environment v3 which is used with Isolated v2 App Service plans
The App Service Environment is a deployment of the Azure App Service that runs within your Azure virtual network. It can be deployed with an internet accessible application endpoint or an application endpoint that is in your virtual network. If you deploy the App Service Environment with an internet accessible endpoint, that deployment is called an External App Service Environment. If you deploy the App Service Environment with an endpoint in your virtual network, that deployment is called an ILB App Service Environment. You can learn more about the ILB App Service Environment from the Create and use an ILB App Service Environment document.
Applications that are hosted in an App Service Environment support the following app-centric certificate features, which are also available in the multi-tenant App Service. For requirements and instructions for uploading and managing those certificates, see Add a TLS/SSL certificate in Azure App Service.
App Service managed certificates aren't supported on apps that are hosted in an App Service Environment.
You can configure the TLS setting at an app level.
Private client certificate
A common use case is to configure your app as a client in a client-server model. If you secure your server with a private CA certificate, you'll need to upload the client certificate to your app. The following instructions will load certificates to the trust store of the workers that your app is running on. You only need to upload the certificate once to use it with apps that are in the same App Service plan.
Private client certificates are only supported from custom code in Windows code apps. Private client certificates are not supported outside the app. This limits usage in scenarios such as pulling the app container image from a registry using a private certificate and TLS validating through the front-end servers using a private certificate.
Follow these steps to upload the certificate (.cer file) to your app in your App Service Environment. The .cer file can be exported from your certificate. For testing purposes, there's a PowerShell example at the end to generate a temporary self-signed certificate:
Go to the app that needs the certificate in the Azure portal
Go to TLS/SSL settings in the app. Select Public Key Certificate (.cer). Select Upload Public Key Certificate. Provide a name. Browse and select your .cer file. Select upload.
Copy the thumbprint.
Go to Configuration > Application Settings. Create an app setting WEBSITE_LOAD_ROOT_CERTIFICATES with the thumbprint as the value. If you have multiple certificates, you can put them in the same setting separated by commas and no whitespace like
The certificate will be available by all the apps in the same app service plan as the app, which configured that setting, but all apps that depend on the private CA certificate should have the Application Setting configured to avoid timing issues.
If you need it to be available for apps in a different App Service plan, you'll need to repeat the app setting operation for the apps in that App Service plan. To check that the certificate is set, go to the Kudu console and issue the following command in the PowerShell debug console:
To perform testing, you can create a self signed certificate and generate a .cer file with the following PowerShell:
$certificate = New-SelfSignedCertificate -CertStoreLocation "Cert:\LocalMachine\My" -DnsName "*.internal-contoso.com","*.scm.internal-contoso.com" $certThumbprint = "Cert:\LocalMachine\My\" + $certificate.Thumbprint $fileName = "exportedcert.cer" Export-Certificate -Cert $certThumbprint -FilePath $fileName -Type CERT
- Information on how to use certificates in application code