Add a New Site
Applies To: Windows Azure Pack
Adds a new site.
Request
Replace {ServiceMgmt} with your Service Management API endpoint address. Replace {Port} with either 30005 for the tenant API or 30006 for the Public Tenant API. Replace {SUBSCRIPTIONID} with the required subscription identifier, and replace {WEBSPACENAME} with the corresponding values for your website.
Method |
Request URI |
HTTP version |
---|---|---|
POST |
https://<ServiceMgmt>:<Port>/{SUBSCRIPTIONID}/services/webspaces/{WEBSPACENAME}/sites |
HTTP/1.1 |
URI Parameters
None.
Request Headers
The following table describes required and optional request headers.
Request header |
Description |
---|---|
x-ms-version |
Required. Specifies the version of the operation to use for this request. This header should be set to 2012-10-10 or the current version. |
Content-Length |
Required. |
Content-Type: application/json; charset=utf-8 |
Required if the request body is sent in JSON format. |
accept: application/json |
Optional. Use this header to receive the response in JSON format. |
Request Body
The code example shows the format of the request body.
<Site xmlns="https://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<HostNames xmlns:a="https://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a:string>contosoapitest.azurewebsites.net</a:string>
</HostNames>
<Name>contosoapitest</Name>
<WebSpaceToCreate>
<GeoRegion>West US</GeoRegion>
<Name>westuswebspace</Name>
<Plan>VirtualDedicatedPlan</Plan>
</WebSpaceToCreate>
</Site>
The following table describes the key elements of the request body.
Element name |
Description |
---|---|
HostNames |
Required. The fully qualified domain name for a website. Only one host name can be specified in the azurewebsites.net domain. The host name should match the name of the website. Custom domains can only be specified for Shared or Standard websites. |
Name |
Required. The name of the website. This name should match the host name in the default domain. |
ComputeMode |
This value should be Shared for the Free or Paid Shared offerings, or Dedicated for the Standard offering. The default value is Shared. If you set the ComputeMode value to Dedicated, you must specify a value for the ServerFarm property. |
ServerFarm |
The name of the server farm associated with this website. This is a required value for Standard mode. |
SiteMode |
This value is Limited for the Free offering Basic for the Paid Shared offering. The default value is Limited. Note Standard mode does not use the SiteMode setting; it uses the ComputeMode setting. |
WebspaceToCreate.GeoRegion |
Required. The geographical region of the webspace to be created. See Quick Reference - Web Sites Service REST API for possible values. |
WebspaceToCreate.Name |
Required. The name of the webspace. |
WebspaceToCreate.Plan |
Required. This value must be VirtualDedicatedPlan. |
Response
The response includes an HTTP status code, a set of response headers, and a response body.
Status Code
A successful operation returns status code 200 (OK).
For information about status codes, see Error Codes (Web Sites Service REST API).
Response Headers
The response for this operation includes the following headers. The response can 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 the request made against the management service. |
Response Body
The code example shows the format of the response body.
{
"AdminEnabled": true,
"AvailabilityState": 0,
"Cers": [
{
"CerBlob": [
81,
109,
70,
122,
90,
83,
65,
50,
78,
67,
66,
84,
100,
72,
74,
108,
89,
87,
48,
61
],
"ExpirationDate": "\/Date(928174800000-0700)\/",
"FriendlyName": "String content",
"HostNames": [
"String content"
],
"IssueDate": "\/Date(928174800000-0700)\/",
"Issuer": "String content",
"Password": "String content",
"PfxBlob": [
81,
109,
70,
122,
90,
83,
65,
50,
78,
67,
66,
84,
100,
72,
74,
108,
89,
87,
48,
61
],
"PublicKeyHash": "String content",
"SelfLink": "http:\/\/www.example.com\/",
"SiteName": "String content",
"SubjectName": "String content",
"Thumbprint": "String content",
"ToDelete": true,
"Valid": true
}
],
"ComputeMode": 0,
"ContentAvailabilityState": 0,
"Csrs": [
{
"CsrString": "String content",
"DistinguishedName": "String content",
"HostNames": [
"String content"
],
"Password": "String content",
"PfxBlob": [
81,
109,
70,
122,
90,
83,
65,
50,
78,
67,
66,
84,
100,
72,
74,
108,
89,
87,
48,
61
],
"PublicKeyHash": "String content",
"SelfLink": "http:\/\/www.example.com\/",
"SiteName": "String content",
"ToDelete": true,
"Valid": true
}
],
"Enabled": true,
"EnabledHostNames": [
"String content"
],
"HostNameSslStates": [
{
"IpBasedSslResult": "String content",
"Name": "String content",
"SslState": 0,
"Thumbprint": "String content",
"ToUpdate": true,
"ToUpdateIpBasedSsl": true,
"VirtualIP": "String content"
}
],
"HostNames": [
"String content"
],
"LastModifiedTimeUtc": "\/Date(928174800000-0700)\/",
"Name": "String content",
"Owner": "String content",
"RepositorySiteName": "String content",
"RuntimeAvailabilityState": 0,
"SSLCertificates": [
{
"CerBlob": [
81,
109,
70,
122,
90,
83,
65,
50,
78,
67,
66,
84,
100,
72,
74,
108,
89,
87,
48,
61
],
"ExpirationDate": "\/Date(928174800000-0700)\/",
"FriendlyName": "String content",
"HostNames": [
"String content"
],
"IssueDate": "\/Date(928174800000-0700)\/",
"Issuer": "String content",
"Password": "String content",
"PfxBlob": [
81,
109,
70,
122,
90,
83,
65,
50,
78,
67,
66,
84,
100,
72,
74,
108,
89,
87,
48,
61
],
"PublicKeyHash": "String content",
"SelfLink": "http:\/\/www.example.com\/",
"SiteName": "String content",
"SubjectName": "String content",
"Thumbprint": "String content",
"ToDelete": true,
"Valid": true
}
],
"SelfLink": "http:\/\/www.example.com\/",
"ServerFarm": "String content",
"SiteMode": "String content",
"SiteProperties": {
"AppSettings": [
{
"Name": "String content",
"Value": "String content"
}
],
"Metadata": [
{
"Name": "String content",
"Value": "String content"
}
],
"Properties": [
{
"Name": "String content",
"Value": "String content"
}
]
},
"State": "String content",
"StorageRecoveryDefaultState": "String content",
"UsageState": 0,
"WebSpace": "String content"
}
The following table describes the key elements of the response body.
Element name |
Description |
---|---|
Site.AdminEnabled |
Read-only. This value is always true. |
Site.AvailabilityState |
The state of the availability of management information for the site. Possible values are Normal or Limited. Normal means that the site is running correctly and that management information for the site is available. Limited means that only partial management information for the site is available and that detailed site information is unavailable. |
Site.ComputeMode |
The compute mode for the website. Possible values are Shared or Dedicated. |
Site.ContentAvailabilityState |
Unused property. |
Site.Enabled |
Set to true if the site is enabled; otherwise, it is false. Setting this value to false disables the site. It takes the site offline. |
Site.EnabledHostNames |
An array of strings that contains enabled host names for the site. By default, these are <SiteName>.azurewebsites.net and<SiteName>.scm.azurewebsites.net. |
Site.HostNameSslStates |
Container element for Secure Socket Layer (SSL) states. |
Site.HostNameSslStates.HostNameSslState |
Contains the status information for an SSL certificate that is bound to the website. |
Site.HostNameSslStates.HostNameSslState.IpBasedSslResult |
Unused property. |
Site.HostNameSslStates.HostNameSslState.Name |
The URL of the website. |
Site.HostNameSslStates.HostNameSslState.SslState |
The SSL state. Possible values are Disabled, SniEnabled, or IpBasedEnabled. |
Site.HostNameSslStates.HostNameSslState.Thumbprint |
A string that contains the thumbprint of the SSL certificate. |
Site.HostNameSslStates.HostNameSslState.ToUpdate |
Boolean. Unused property. |
Site.HostNameSslStates.HostNameSslState.ToUpdateIpBasedSsl |
Boolean. Unused property. |
Site.HostNameSslStates.HostNameSslState.VirtualIP |
A string that contains the IP address that is assigned to the host name if the host name uses IP SSL. |
Site.HostNames |
An array of strings that contains the public host names for the site, which include custom domains. Important When you add a custom domain in a PUT operation, be sure to include every host name that you require for the website. To delete a custom domain name in a PUT operation, include all of the host names for the site that you have to keep, but omit the one that you have to delete. For more information about custom domains on Windows Azure, see Configuring a custom domain name for a Windows Azure web site. |
Site.LastModifiedTimeUtc |
A dateTime value that contains, in Coordinated Universal Time (UTC), the last time the website was modified. |
Site.Name |
The name of the website. |
Site.Owner |
Read-only property. |
Site.RepositorySiteName |
The name of the repository website. |
Site.RuntimeAvailabilityState |
Possible values are Normal, Degraded, or Not Available. Normal: the website is running correctly. Degraded: the website is running temporarily in a degraded mode, typically with less memory and a shared instance. Not Available: due to an unexpected issue, the site has been excluded from provisioning. This value typically occurs only for free sites. |
Site.SSLCertificates |
An array of SSL certificates. |
Site.SSLCertificates.Certificate |
Contains SSL certificate properties. |
Site.SSLCertificates.Certificate.ExpirationDate |
A dateTime value that contains the expiration date of the certificate. |
Site.SSLCertificates.Certificate.FriendlyName |
A string that contains the friendly name of the certificate. |
Site.SSLCertificates.Certificate.HostNames |
An array of strings that contain the host names to which the certificate is bound. |
Site.SSLCertificates.Certificate.IssueDate |
A dateTime value that contains the date that the certificate was issued. |
Site.SSLCertificates.Certificate.Issuer |
A string that identifies the issuer of the certificate. |
Site.SSLCertificates.Certificate.Password |
A string that contains the password for the certificate. |
Site.SSLCertificates.Certificate.PfxBlob |
A base64Binary value that contains the PfxBlob of the certificate. |
Site.SSLCertificates.Certificate.SelfLink |
A URI value that contains the endpoint of the site to which the certificate is bound. |
Site.SSLCertificates.Certificate.SiteName |
A string that contains the name of the site to which the certificate is bound. |
Site.SSLCertificates.Certificate.SubjectName |
A string that contains the name of the entity to whom the certificate was issued. |
Site.SSLCertificates.Certificate.Thumbprint |
A string that contains the certificate thumbprint. |
Site.SSLCertificates.Certificate.ToDelete |
Boolean. If the certificate is to be deleted, it is true; otherwise it is false. |
Site.SSLCertificates.Certificate.Valid |
Boolean. If the certificate is valid, it is true; otherwise, it is false. |
Site.SelfLink |
Direct URL to the website endpoint on Windows Azure Web Sites, which includes the subscription ID, webspace name, and site name. |
Site.ServerFarm |
A string for which, if a server farm exists, the value is DefaultServerFarm. |
Site.SiteMode |
String that represents the website mode. If the website mode is Free, this value is Limited. If the website mode is Shared, this value is Basic. Note The SiteMode property value is not used for Reserved mode. Reserved mode uses the ComputeMode setting. |
Site.SiteProperties |
Contains AppSettings, Metadata, and Properties as sets of name/value pairs for a site. |
Site.SiteProperties.AppSettings |
A set of name/value pairs that contain application settings for a site. |
Site.SiteProperties.Metadata |
A set of name/value pairs that contain metadata information for a site. |
Site.SiteProperties.Properties |
A set of name/value pairs that contain properties for a site. |
Site.State |
A string that describes the state of the website. Possible values are Stopped or Running. |
Site.StorageRecoveryDefaultState |
Unused property. |
Site.UsageState |
Possible values are Normal or Exceeded. If any quota is exceeded, the UsageState value changes to Exceeded and the site goes offline. |
Site.WebSpace |
The name of the webspace in which the website is located. This property is read-only. For possible values, see Quick Reference - Web Sites Management REST API. |