0 out of 3 rated this helpful - Rate this topic

Create Hosted Service

Updated: June 7, 2012

The Create Hosted Service operation creates a new cloud service in Windows Azure.

Request

The Create Hosted Service request may be specified as follows. Replace <subscription-id> with your subscription ID.

 

Method Request URI HTTP Version

POST

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

HTTP/1.1

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. The value of this header must be set to 2010-10-28 or later. For more information about versioning headers, see Service Management Versioning.

Request Body

The format of the request body is as follows:

<?xml version="1.0" encoding="utf-8"?>
<CreateHostedService xmlns="http://schemas.microsoft.com/windowsazure">
  <ServiceName>service-name</ServiceName>
  <Label>base64-encoded-service-label</Label>
  <Description>description</Description>
  <Location>location</Location>
  <AffinityGroup>affinity-group</AffinityGroup>
  <ExtendedProperties>
    <ExtendedProperty>
      <Name>property-name</Name>
      <Value>property-value</Value>
    </ExtendedProperty>
  </ExtendedProperties>
</CreateHostedService>
ImportantImportant
The order of the elements in the request body is significant. If an element is required, it must appear in the XML in the order shown above.

The following table describes the key elements of the request body:

 

Element Name

Description

ServiceName

Required. A name for the cloud service that is unique within Windows Azure. This name is the DNS prefix name and can be used to access the service.

For example: http://ServiceName.cloudapp.net//

Label

Required. A name for the cloud service that is base-64 encoded. The name can be up to 100 characters in length. The name can be used identify the storage account for your tracking purposes.

Description

Optional. A description for the cloud service. The description can be up to 1024 characters in length.

Location

Required if AffinityGroup is not specified. The location where the cloud service will be created.

Specify either Location or AffinityGroup, but not both. To list available locations, use the List Locations operation.

AffinityGroup

Required if Location is not specified. The name of an existing affinity group associated with this subscription. This name is a GUID and can be retrieved by examining the name element of the response body returned by the List Affinity Groups operation

Specify either Location or AffinityGroup, but not both. To list available affinity groups, use the List Affinity Groups operation.

Name

Optional. Represents the name of an extended cloud service property. Each extended property must have both a defined name and value. You can have a maximum of 50 extended property name and value pairs.

The maximum length of the Name element is 64 characters, only alphanumeric characters and underscores are valid in the name, and it must start with a letter. Attempting to use other characters, starting with a non-letter character, or entering a name that is identical to that of another extended property owned by the same service, will result in a status code 400 (Bad Request) error.

The Name element is only available using version 2012-03-01 or higher.

Value

Optional. Represents the value of an extended cloud service property. Each extended property must have both a defined name and value. You can have a maximum of 50 extended property name and value pairs, and each extended property value has a maximum length of 255 characters.

The Value element is only available using version 2012-03-01 or higher.

Response

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

Status Code

A successful operation returns status code 201 (Created). For information about status codes, see Service Management Status and Error Codes.

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

 

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. See Tracking Asynchronous Service Management Requests for more information.

Response Body

None.

Authorization

Any management certificate associated with the subscription specified by <subscription-id> can be used to authenticate this operation. For additional details, see Authenticating Service Management Requests.

Remarks

If the value of x-ms-version is 2012-03-01 or later, a cloud service cannot be created in the Anywhere US, Anywhere Europe, or Anywhere Asia regions, which are now deprecated, unless you use a pre-existing affinity group that is set to one of these locations.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.