webapp: Support the new appservice Managed certificates (preview) #10518
Closed
Description
Description of the new feature
Appservice released the new preview feature at Ignite 2019 https://azure.github.io/AppService/2019/11/04/Announcing-Managed-Certificates.html
We need first class command support for this feature using CLI
Current workaround script to use with PowerShell
Required: custom domain www..com should be assigned to your websites.
#Connect-AzureRmAccount
$resourceGroupName = "myRG"
New-AzureRMResourceGroupDeployment -ResourceGroupName $resourceGroupName `
-TemplateFile "FreeSSLCert2.json"
ARM Template:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"variables": {
"webAppName": "mywebapp",
"cusomDomain": "www.myCustomDomain.com",
"certificateName": "www.myCustomDomain.com",
"AppServicePlanName": "myASP"
},
"resources": [
{
"apiVersion": "2019-08-01",
"location": "[resourceGroup().location]",
"name": "[variables('certificateName')]",
"type": "Microsoft.Web/certificates",
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', variables('AppServicePlanName'))]",
"canonicalName": "[variables('cusomDomain')]"
}
},
{
"apiVersion": "2019-08-01",
"type": "Microsoft.Web/sites/hostnameBindings",
"name": "[concat(variables('webAppName'),'/',variables('cusomDomain'))]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Web/certificates/',variables('certificateName'))]"
],
"properties": {
}
}
]
}