question

CameronLangsford-2982 avatar image
0 Votes"
CameronLangsford-2982 asked CameronLangsford-2982 commented

Error creating Azure app service managed certificate

In the Azure portal I'm trying to create an app managed certificate for a new domain.

I have successfully created top level naked certificates before without any issues.

This is the error

Properties.CanonicalName is invalid. Canonical name flexfitnessmount.co.nz is not a subdomain. This validation method only supports subdomains.

I think this error is not quite right as it's obvious that this is not a sub domain so I don't known why it is trying to use a validation method that only supports a sub domain in this case.

I wonder because it's .co.nz instead of .com it's getting confused and the extra part of the domain is causing it to think it should be validating a sub domain.

azure-webapps-ssl-certificates
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Grmacjon-MSFT avatar image
0 Votes"
Grmacjon-MSFT answered CameronLangsford-2982 commented

Hi @CameronLangsford-2982 ,


Can you please try this Powershell script:


 $subscription = "SUBSCRIPTION-ID"
   $resourceGroupName = "RESOURCE-GROUP-NAME"
   $appServicePlanName = "APP-SERVICE-PLAN-NAME"
   $subjectName = "DOMAIN-NAME"
            
   Set-AzureRmContext -SubscriptionId $subscription
            
   $appServicePlan = Get-AzureRmResource `
       | Where-Object {$_.ResourceGroupName -eq $resourceGroupName } `
       | Where-Object {$_.Name -eq $appServicePlanName}
            
   New-AzureRMResourceGroupDeployment `
       -ResourceGroupName $resourceGroupName `
       -SubjectName $subjectName `
       -AppServicePlanName $appServicePlanName `
       -Location $appServicePlan.Location `
       -TemplateFile "CreateHttpFreeCert.json" 

This script will only create an App Service Managed Certificate for a custom domain that has already been added to your web app. If you run this script before adding a custom domain to the web app, the script will fail.

Thanks,
Grace

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you that worked great!

Any idea when this will be fixed so it can be done using the user interface?

Thanks
Cam

0 Votes 0 ·
Grmacjon-MSFT avatar image Grmacjon-MSFT CameronLangsford-2982 ·

Glad it worked. The App Service Managed Certificate team is aware of this issue and working to deploy a fix soon.

-Grace

0 Votes 0 ·