I'm using Python to automate the creation of an App Service Cerficate for my Azure application (an AKS cluster). One of the REST calls I need to make is described here:
https://learn.microsoft.com/en-us/rest/api/appservice/appservicecertificateorders/createorupdate
This describes the call that's needed to create an App Service Cerficate Order, the result of which is then passed on to the REST call to create the App Service Certificate.
My problem is I can't figure out from the sparse documentation what is needed in the request body for this REST call. I've build a structure that looks like this:
request_body = {
"location" : "eastus",
"properties" : {
"autoRenew" : true,
"productType" : "StandardDomainValidatedSsl",
"distinguishedName": "???",
"csr": "???"
}
}
I've been unable to figure out what is needed for these last two fields. The csr field is described as "Last CSR that was created for this order", with CSR referring to a Certificate Signing Request. The way this is worded implies there was a previous CSR but this is a new request and I have nothing previous to fill in here. If I try to leave distguishedName and csr both blank, the call complains. I've tried creating a CSR with openssl and setting the csr field to the value that's created but it doesn't seem to like it. The distinquishedName field I assume is supposed to something like
"CN=mydomain.com,C=US,ST=California,..."
but it always complains that whatever I provide is invalid.
I've done some searches and can find no examples of what is needed for this REST call. If anyone can point me to some sample code or additional documentation, I'd appreciate it. Thanks.
Peter