Azure Rest Api Create Managed Ssl certificate through code.

Ticu Ionut 1 Reputation point
2021-09-16T14:08:35.367+00:00

Hi,
I am trying to create through the azure rest api a managed ssl certificate.
I am getting 500 internal error.

This is the endpoint i am using https://learn.microsoft.com/en-us/rest/api/appservice/certificates/create-or-update#code-try-0

Question 1. Is this the endpoint used to create a managed ssl certificate?
Question 2. If this is can someone try and share if the end point works?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,876 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 16,011 Reputation points
    2021-09-17T22:47:44.94+00:00

    Hi @Ticu Ionut

    Yes, that is the right REST API to create Managed SSL certificate. All you need is to put the canonical and host names in the request body.

    PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282?api-version=2019-08-01

    {  
      
        "location": "East US",  
        "properties": {  
            "canonicalName": "My Managed Cert Name",  
            "hostNames": [  
                "ServerCert"  
            ]  
        }  
          
        }  
    

    Hope that helps.

    Thanks,
    Grace

    0 comments No comments