Search code examples
powershellazuresslclient-certificates

How To Configure TLS Mutual Authentication for Azure Web App through PowerShell?


According to the docs you can set ClientCertEnabled through the ARMClient Tool. You can nowadays also use https://resources.azure.com to do so or even set it as property in ARM Templates.

Is there any possibility to set it directly through Azure PowerShell? I found that retrieving an app through Get-AzureRmWebApp also states if ClientCertificates are enabled or not.


Solution

  • Yes, you can set it on the underlying resource. Sample:

    $Resource = Get-AzureRmResource -ResourceGroupName $resourceGroupName -ResourceType Microsoft.Web/sites -ResourceName $resourceName -ApiVersion 2016-08-01
    $Resource.Properties.clientCertEnabled = "True"
    $Resource | Set-AzureRmResource -Force
    

    HTH