Add Service Certificate

 

The Add Service Certificate asynchronous operation adds a certificate to a cloud service.

Request

The Add Service Certificate request may be specified as follows. Replace <subscription-id> with the subscription ID, and <service-name> with the DNS prefix name of the cloud service.

Method

Request URI

POST

https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/certificates

URI Parameters

None.

Request Headers

The following table describes the request headers.

Request Header

Description

Content-Type

Required. Set this header to application/xml.

x-ms-version

Required. Specifies the version of the operation to use for this request. This header should be set to 2009-10-01 or higher.

Request Body

<?xml version="1.0" encoding="utf-8"?>
<CertificateFile xmlns=”https://schemas.microsoft.com/windowsazure”>
  <Data>base64-encoded-file</Data>
  <CertificateFormat>file-format</CertificateFormat>
  <Password>pfx-file-password</Password>
</CertificateFile>

The following table describes the elements in the request body.

Element name

Description

Data

Required. Specifies the base-64 encoded form of the .pfx or .cer file.

The service certificate is added as either a .pfx or .cer file. When retrieving the service certificate using the List Service Certificates or Get Service Certificate operation, only the public portion of the certificate is returned as a .cer file.

CertificateFormat

Required. Specifies the format of the service certificate.

Possible values are:

  • pfx

  • cer

Password

Specifies the password for a .pfx certificate. A .cer certificate does not require a password.

Response

The response includes an HTTP status code and a set of response headers.

Status Code

A successful operation returns status code 200 (OK).

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers.

Response Header

Description

x-ms-request-id

A value that uniquely identifies a request made against the management service. For an asynchronous operation, you can call Get Operation Status with the value of the header to determine whether the operation is complete, has failed, or is still in progress.

Response Body

None.