-
-
Notifications
You must be signed in to change notification settings - Fork 63
REST API
Tatsuro Shibamura edited this page Mar 3, 2021
·
4 revisions
If you only want to use the API externally, disable App Service Authentication and use the Azure Functions Host Key to execute the API.
- Make a POST request to the Add Certificate endpoint
- 202 Accepted with Location header is returned.
- Execute periodically until the endpoint returned by the Location header returns something other than 202 Accepted.
POST /api/certificate
X-Functions-Key: <host key is here>
{
"AppName": "app-sandbox",
"ResourceGroupName": "rg-sandbox",
"SlotName": "production",
"DnsNames": ["contoso.com", "www.contoso.com"],
"UseIpBasedSsl": false,
"ForceDns01Challenge": false
}
202 Accepted
Location: /api/certificate/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
400 Bad Request
{
"errors": {
"DnsNames": [
"The DnsNames is required."
]
},
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-e2468d29d2988e4490e92e2768b622b0-92d30024b7066e4d-00"
}
401 Unauthorized
GET /api/certificate/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-Functions-Key: <host key is here>
200 OK
202 Accepted
Location: /api/certificate/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
500 Internal Server Error