SALES: 1-800-867-1380

Get or Set Config Details for a Site

Updated: January 15, 2014

You can retrieve the config settings for a web site by issuing an HTTP GET request, or update them by using HTTP PUT with a request body that contains the settings to be updated.

Request

To retrieve or set the configuration settings for a web site, specify the request with GET or PUT as follows. Replace <Subscription-Id>, <WebSpaceName>, and <SiteName> with the corresponding values for your web site.

 

Method Request URI HTTP Version

GET

https://management.core.windows.net/<Subscription-Id>/services/WebSpaces/<WebSpaceName>/sites/<SiteName>/config

HTTP/1.1

PUT

https://management.core.windows.net/<Subscription-Id>/services/WebSpaces/<WebSpaceName>/sites/<SiteName>/config

HTTP/1.1

URI Parameters

None.

Request Headers

The following table describes required and optional request headers.

 

Request Header Description

x-ms-version

Optional. Specifies the version of the operation to use for this request. If you do not specify a version, the latest version is used. For more information about versioning headers, see API Versioning on the Web Sites Management REST API Reference page.

accept: application/json

Optional. Use this header to receive the response in JSON format.

Content-Length

Required for the PUT operation.

Content-Type: application/json; charset=utf-8

Required if the request body is sent in JSON format.

Request Body

For a PUT operation, specify the values to be changed in the same format as the format used in the response body. For more information, see the Response Body section and Key Elements table later on this page.

The following example request body enables detailed error message logging for site diagnostics by using the <DetailedErrorLoggingEnabled> element:


<SiteConfig xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <DetailedErrorLoggingEnabled>true</DetailedErrorLoggingEnabled>
</SiteConfig>


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 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 the request made against the Management service.

Response Body

The following is an example JSON response body for the 2012-10-10 version. Some fields have placeholder values.

{
  "AppSettings":[{
    "Name":"String content",
    "Value":"String content"
  }],
  "ConnectionStrings":[{
    "ConnectionString":"String content",
    "Name":"String content",
    "Type":0
  }],
  "DefaultDocuments": ["Default.htm", "Default.html", "Default.asp", "index.htm", "index.html", "iisstart.htm", "default.aspx", "index.php", "hostingstart.html"],
  "DetailedErrorLoggingEnabled":true,
  "DocumentRoot": null,
  "HandlerMappings":[{
    "Arguments":"String content",
    "Extension":"String content",
    "ScriptProcessor":"String content"
  }],
  "HttpLoggingEnabled":true,
  "Metadata":[{
    "Name":"String content",
    "Value":"String content"
  }],
  "NetFrameworkVersion":"v4.0",
  "NumberOfWorkers":1,
  "PhpVersion":"5.3",
  "PublishingPassword":"qBZygXPsKnxhFfQHhETJijXpviafh1wm1KKc1nMpuJlwvTz5ppwQt4vqBavq",
  "PublishingUsername":"$contoso",
  "RequestTracingEnabled":true,
  "RequestTracingExpirationTime":"\/Date(928149600000+0000)\/",
  "ScmType":"LocalGit",
  "Use32BitWorkerProcess":true
  "WebSocketsEnabled": false

The following is an example XML response body for the 2012-10-10 version. Some fields have placeholder values.


<SiteConfig xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <AppSettings>
    <NameValuePair>
      <Name>String content</Name>
      <Value>String content</Value>
    </NameValuePair>
  </AppSettings>
  <ConnectionStrings>
    <ConnStringInfo>
      <ConnectionString>String content</ConnectionString>
      <Name>DefaultSQLConnection</Name>
      <Type>SQLAzure</Type>
    </ConnStringInfo>
    <ConnStringInfo>
      <ConnectionString>String content</ConnectionString>
      <Name>Contoso4AIhZ26D1</Name>
      <Type>MySql</Type>
    </ConnStringInfo>
  </ConnectionStrings>
  <DefaultDocuments xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <a:string>Default.htm</a:string>
    <a:string>Default.html</a:string>
    <a:string>Default.asp</a:string>
    <a:string>index.htm</a:string>
    <a:string>index.html</a:string>
    <a:string>iisstart.htm</a:string>
    <a:string>default.aspx</a:string>
    <a:string>index.php</a:string>
    <a:string>hostingstart.html</a:string>
  </DefaultDocuments>
  <DetailedErrorLoggingEnabled>true</DetailedErrorLoggingEnabled>
  <DocumentRoot i:nil="true" />
  <HandlerMappings>
    <HandlerMapping>
      <Arguments>String content</Arguments>
      <Extension>String content</Extension>
      <ScriptProcessor>String content</ScriptProcessor>
    </HandlerMapping>
  </HandlerMappings>
  <HttpLoggingEnabled>true</HttpLoggingEnabled>
  <Metadata>
    <NameValuePair>
      <Name>OAuthToken</Name>
      <Value>String content</Value>
    </NameValuePair>
    <NameValuePair>
      <Name>dropbox_path</Name>
      <Value>/MyWebSite</Value>
    </NameValuePair>
    <NameValuePair>
      <Name>dropbox_username</Name>
      <Value>Username</Value>
    </NameValuePair>
    <NameValuePair>
      <Name>dropbox_email</Name>
      <Value>user@contoso.com</Value>
    </NameValuePair>
    <NameValuePair>
      <Name>ScmUri</Name>
      <Value>https://www.dropbox.com/home/Apps//MyWebSite</Value>
    </NameValuePair>
  </Metadata>
  <NetFrameworkVersion>v4.0</NetFrameworkVersion>
  <NumberOfWorkers>1</NumberOfWorkers>
  <PhpVersion>5.3</PhpVersion>
  <PublishingPassword>qBZygXPsKnMpuJlwvTzETJijXpviafh1wm1KKc1n5ppwQtxhFfQHh4vqBavq</PublishingPassword>
  <PublishingUsername>$ContosoSite</PublishingUsername>
  <RequestTracingEnabled>true</RequestTracingEnabled>
  <RequestTracingExpirationTime>1999-05-31T11:20:00</RequestTracingExpirationTime>
  <ScmType>LocalGit</ScmType>
  <Use32BitWorkerProcess>true</Use32BitWorkerProcess>
  <WebSocketsEnabled>false</WebSocketsEnabled>
</SiteConfig>

TipTip
To retrieve a list of all websites in a webspace, you can issue an HTTP GET request in the following format:

https://management.core.windows.net<Subscription-Id>/services/WebSpaces/<WebSpaceName>/sites/

For more information, see Get a List of All Web Sites in a Webspace.

Key Elements

The following table describes the key elements of the response body.

 

Element Name Description

SiteConfig.AppSettings

Contains application specific settings in the form of name/value pairs.

SiteConfig.ConnectionStrings

Contains connection strings for database and other external resources.

SiteConfig.ConnectionStrings.ConnStringInfo

Container element for the information of a single connection string.

SiteConfig.ConnectionStrings.ConnStringInfo.ConnectionString

A database connection string.

SiteConfig.ConnectionStrings.ConnStringInfo.ConnectionString.Name

The name of the connection string.

SiteConfig.ConnectionStrings.ConnStringInfo.ConnectionString.Type

The type of the connection string (for example, "MySQL").

SiteConfig.DefaultDocuments

Contains one or more string elements that list, in order of preference, the name of the file that a web site returns when the web site's domain name is requested by itself. For example, if the default document for http://contoso.com is default.htm, the page http://www.contoso.com/default.htm is returned when the browser is pointed to http://www.contoso.com.

SiteConfig.DetailedErrorLoggingEnabled

True if detailed error logging is enabled; otherwise, false.

SiteConfig.DocumentRoot

Not used for Windows Azure Web Sites.

SiteConfig.HandlerMappings

Specifies custom executable programs for handling requests for specific file name extensions.

SiteConfig.HandlerMappings.HandlerMapping

Container element for a single handler mapping.

SiteConfig.HandlerMappings.HandlerMapping.Arguments

A string that contains optional arguments for the script processor specified by the SiteConfig.HandlerMappings.HandlerMapping.ScriptProcessor element.

SiteConfig.HandlerMappings.HandlerMapping.Extension

A string that specifies the extension of the file type that the script processor will handle (for example, *.php).

SiteConfig.HandlerMappings.HandlerMapping.ScriptProcessor

The absolute path to the location of the executable file that will handle the files specified in the SiteConfig.HandlerMappings.HandlerMapping.Extension element.

SiteConfig.HttpLoggingEnabled

True if HTTP error logging is enabled; otherwise, false.

SiteConfig.Metadata

Contains name/value pairs for source control or other information.

SiteConfig.NetFrameworkVersion

The .NET Framework version. Supported values are v2.0 and v4.0.

SiteConfig.NumberOfWorkers

The number of web workers allotted to the web site. If the site mode is Free, this value is 1. If the site mode is Shared, this value can range from 1 through 6. If the site mode is Standard, this value can range from 1 through 10.

noteNote
This value is effectively ignored when the site is in reserve mode.

SiteConfig.PhpVersion

Supported values are an empty string (an empty string disables PHP), 5.3, and 5.4.

SiteConfig.PublishingPassword

Hash value of the password used for publishing the web site.

SiteConfig.PublishingUsername

The username used for publishing the web site. This is normally a dollar sign prepended to the web site name (for example, “$contoso”).

SiteConfig.RequestTracingEnabled

True if request tracing is enabled; otherwise, false.

SiteConfig.RequestTracingExpirationTime

Time remaining until request tracing expires.

SiteConfig.ScmType

The source control method that the web site is using (for example, Local Git). If deployment from source control has not been set up for the web site, this value is None.

SiteConfig.Use32BitWorkerProcess

True if 32-bit mode is enabled; otherwise, false.

WebSocketsEnabled

Not used for Windows Azure Web Sites.

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.

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft