Create Deployment
Updated: June 7, 2012
The Create Deployment operation uploads a new service package and creates a new deployment in the staging or production environments.
The Create Deployment operation is an asynchronous operation. To determine whether the management service has finished processing the request, call Get Operation Status. For more information on asynchronous operations, see Tracking Asynchronous Service Management Requests.
Request
The Create Deployment request may be specified as follows. Replace <subscription-id> with your subscription ID, <cloudservice-name> with the name of the cloud service, and <deployment-slot> with staging or production.
| Method | Request URI | HTTP Version |
|---|---|---|
|
POST |
|
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. This header should be set to 2009-10-01 or later. For more information about versioning headers, see Service Management Versioning. |
Request Body
The format of the request body is as follows. Note that the XML elements must be specified in the order shown:
<?xml version="1.0" encoding="utf-8"?>
<CreateDeployment xmlns="http://schemas.microsoft.com/windowsazure">
<Name>deployment-name</Name>
<PackageUrl>package-url-in-blob-storage</PackageUrl>
<Label>base64-encoded-deployment-label</Label>
<Configuration>base64-encoded-configuration-file</Configuration>
<StartDeployment>true|false</StartDeployment>
<TreatWarningsAsError>true|false</TreatWarningsAsError>
<ExtendedProperties>
<ExtendedProperty>
<Name>property-name</Name>
<Value>property-value</Value>
</ExtendedProperty>
</ExtendedProperties>
<ExtensionConfiguration>
<AllRoles>
<Extension>
<Id>identifier-of-extension</Id>
</Extension>
...
</AllRoles>
<NamedRoles>
<Role>
<RoleName>role_name1</RoleName>
<Extensions>
<Extension>
<Id>identifier-of-extension</Id>
</Extension>
...
</Extensions>
</Role>
</NamedRoles>
</ExtensionConfiguration>
</CreateDeployment>
The following table describes the key elements in the request body:
| Element name | Description |
|---|---|
|
Name |
Required. The name for the deployment. The deployment name must be unique among other deployments for the cloud service. |
|
PackageUrl |
Required. A URL that refers to the location of the service package in the Blob service. The service package can be located either in a storage account beneath the same subscription or a Shared Access Signature (SAS) URI from any storage account. For more info about Shared Access Signatures, see Use a Shared Access Signature. |
|
Configuration |
Required. The base-64 encoded service configuration file for the deployment. |
|
Label |
Required. A name for the hosted service that is base-64 encoded. The name can be up to 100 characters in length. It is recommended that the label be unique within the subscription. The name can be used identify the hosted service for your tracking purposes. |
|
StartDeployment |
Optional. Indicates whether to start the deployment immediately after it is created. The default value is false. If false, the service model is still deployed to the virtual machines but the code is not run immediately. Instead, the service is Suspended until you call Update Deployment Status and set the status to Running, at which time the service will be started. A deployed service still incurs charges, even if it is suspended. The StartDeployment element is only available using version 2010-04-01 or higher. |
|
TreatWarningsAsError |
Optional. Indicates whether to treat package validation warnings as errors. The default value is false. If set to true, the Created Deployment operation fails if there are validation warnings on the service package. The TreatWarningsAsError element is only available using version 2011-04-01 or higher. |
|
Name |
Optional. Represents the name of an extended deployment property. Each extended property must have both a defined name and value. You can have a maximum of 25 extended property name/value pairs. The maximum length of the Name element is 64 characters, only alphanumeric characters and underscores are valid in the Name, and the name must start with a letter. Attempting to use other characters, starting the Name with a non-letter character, or entering a name that is identical to that of another extended property owned by the same hosted 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 25 extended property name/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. |
|
Optional. Represents an extension that is added to the cloud service. In Windows Azure, a process can run as an extension of a cloud service. For example, Remote Desktop Access or the Windows Azure Diagnostics Agent can run as extensions to the cloud service. You must add an extension to the cloud service by using Add Extension before it can be added to the deployment. The ExtensionConfiguration element is only available using version 2013-03-01 or higher. |
ExtensionConfiguration
Represents an extension that is added to the cloud service.
| Element name | Description |
|---|---|
|
AllRoles |
Optional. Specifies a list of extensions that are applied to all roles in a deployment. |
|
Required. Represents an extension that is to be deployed to a role in a cloud service. |
|
|
Optional. Specifies a list of extensions that are applied to specific roles in a deployment. |
Extension
Represents an extension that is to be deployed to a role in a cloud service.
| Element name | Description |
|---|---|
|
Id |
Required. The identifier of the extension. The identifier is created when the extension is added to the cloud service. You can find the Id of an extension that was added to a cloud service by using List Extensions. |
NamedRoles
Specifies a list of extensions that are applied to specific roles in a deployment.
| Element name | Description |
|---|---|
|
Role |
Required. Represents a specific role to which the extension is added. |
|
RoleName |
Required. Specifies the name of the role. |
|
Required. Represents an extension that is to be deployed to a role in a cloud service. |
Response
The response includes an HTTP status code and a set of response headers.
Because Create Deployment is an asynchronous operation, you must call Get Operation Status to determine whether the operation is complete, has failed, or is still in progress.
Status Code
Because Create Deployment is an asynchronous operation, it always returns status code 202 (Accept). To determine the status code for the operation once it is complete, call Get Operation Status. The status code is embedded in the response for this operation; if successful, it will be status code 200 (OK). 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
None.