0
votes

I have a number of Azure cloud services running that are using the same certificate. I am trying to find a way to programmatically upload a new certificate, then update the thumbprint on each role configuration, using the management api.

I have found the information for adding the certificate here: http://msdn.microsoft.com/en-us/library/windowsazure/ee460817.aspx, but I cannot find how to change the thumbprint in each service without republishing. Can someone point me in the right direction? I am looking to create a simple c# console app to accomplish this.

1

1 Answers

0
votes

There is no specific API operation to change the certificate, however, you can upload a new version of your service configuration (.cscfg file) containing the new thumbprint by doing a POST to the change deployment configuration operation:

https://management.core.windows.net/<subscription-id>/services/hostedservices/<cloudservice-name>/deploymentslots/<deployment-slot>/?comp=config

The body of the POST request should contain a base64 encoded representation of the new .cscfg file content:

<?xml version="1.0" encoding="utf-8"?>
<ChangeConfiguration xmlns="http://schemas.microsoft.com/windowsazure">
  <Configuration>base-64-encoded-configuration-file</Configuration>
</ChangeConfiguration>

This is equivalent to uploading a new configuration from the Azure management portal from the Configure tab:

How to upload a new configuration from the Azure portal

The relevant MSDN link is

http://msdn.microsoft.com/en-us/library/windowsazure/ee460809.aspx