Creating App Service Managed Certificates via API

Matt Honeycutt 21 Reputation points
2021-07-27T22:05:54.093+00:00

Now that App Service Managed Certificates are Generally Available, is there a way to create one programmatically with the API? I've seen the workaround that suggests calling Powershell to execute the command through the CLI, but that's not a great option for our particular use case.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,758 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ryan Hill 28,106 Reputation points Microsoft Employee
    2021-07-29T16:59:51.847+00:00

    Hi @Matt Honeycutt ,

    Yes, you should be able to. Have a look at https://learn.microsoft.com/en-us/rest/api/appservice/certificates/create-or-update. All that should be required is canonical and host names in the request body.

    PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}?api-version=2019-08-01

       {  
           "location": "East US",  
           "properties": {  
               "canonicalName": "My Managed Cert Name",  
               "hostNames": [  
                   "ServerCert"  
               ]  
           }  
       }  
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.