Set Blob Service Properties (REST API)
Updated: September 13, 2011
The Set Blob Service Properties operation sets the properties of a storage account’s Blob service, including Windows Azure Storage Analytics. You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
Request
The Set Blob Service Properties request may be specified as follows. HTTPS is recommended. Replace <account-name> with the name of your storage account:
| Method | Request URI | HTTP Version |
|---|---|---|
|
PUT |
|
HTTP/1.1 |
Note that the URI must always include the forward slash (/) to separate the host name from the path and query portions of the URI. In the case of this operation, the path portion of the URI is empty.
URI Parameters
| URI Parameter | Description |
|---|---|
|
restype=service&comp=properties |
Required. The combination of both query strings is required to set the storage service properties. |
|
timeout |
Optional. The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. |
Request Headers
The following table describes required and optional request headers.
| Request Header | Description |
|---|---|
|
Authorization |
Required. Specifies the authentication scheme, storage account name, and signature. For more information, see Authentication for the Windows Azure Storage Services. |
|
Date or x-ms-date |
Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authentication for the Windows Azure Storage Services. |
|
x-ms-version |
Required for all authenticated requests. Specifies the version of the operation to use for this request. For more information, see Versioning for the Blob, Queue, and Table services in Windows Azure. |
Request Body
The format of the request body is as follows:
<?xml version="1.0" encoding="utf-8"?>
<StorageServiceProperties>
<Logging>
<Version>version-number</Version>
<Delete>true|false</Delete>
<Read>true|false</Read>
<Write>true|false</Write>
<RetentionPolicy>
<Enabled>true|false</Enabled>
<Days>number-of-days</Days>
</RetentionPolicy>
</Logging>
<Metrics>
<Version>version-number</Version>
<Enabled>true|false</Enabled>
<IncludeAPIs>true|false</IncludeAPIs>
<RetentionPolicy>
<Enabled>true|false</Enabled>
<Days>number-of-days</Days>
</RetentionPolicy>
</Metrics>
<!-- The DefaultServiceVersion element can only be set for the Blob service and the request must be made using the 2011-08-18 version -->
<DefaultServiceVersion>default-service-version-string</DefaultServiceVersion>
</StorageServiceProperties>
The following table describes the elements of the request body:
| Element Name | Description |
|---|---|
|
Version |
Required. The version of Storage Analytics to configure. |
|
Delete |
Required. Applies only to logging configuration. Indicates whether all delete requests should be logged. |
|
Read |
Required. Applies only to logging configuration. Indicates whether all read requests should be logged. |
|
Write |
Required. Applies only to logging configuration. Indicates whether all write requests should be logged. |
|
Enabled |
Required. Indicates whether metrics is enabled for the storage service. |
|
IncludeAPIs |
Required only if metrics is enabled. Applies only to metrics configuration. Indicates whether metrics should generate summary statistics for called API operations. |
|
RetentionPolicy/Enabled |
Required. Indicates whether a retention policy is enabled for the storage service. |
|
RetentionPolicy/Days |
Required only if a retention policy is enabled. Indicates the number of days that metrics or logging data should be retained. All data older than this value will be deleted. The minimum value you can specify is |
|
DefaultServiceVersion |
Optional. Applies only to the Blob service, and the request to set DefaultServiceVersion must use version 2011-08-18 of the Set Blob Service Properties operation. Indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Values include version 2009-09-19 and more recent versions. For more information on applicable versions, see Versioning for the Blob, Queue, and Table services in Windows Azure. |
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 202 (Accepted).
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 service. |
|
x-ms-version |
Specifies the version of the operation used for the response. For more information, see Versioning for the Blob, Queue, and Table services in Windows Azure. |
Response Body
None.
Authorization
Only the account owner may call this operation.
Sample Request and Response
The following sample URI makes a request to change the Blob service properties for the fictional storage account named myaccount:
PUT https://myaccount.blob.core.windows.net/?restype=service&comp=properties HTTP/1.1
The request is sent with the following headers:
x-ms-version: 2011-08-18 x-ms-date: Tue, 30 Aug 2011 04:28:19 GMT Authorization: SharedKey myaccount:Z1lTLDwtq5o1UYQluucdsXk6/iB7YxEu0m6VofAEkUE= Host: myaccount.blob.core.windows.net
The request is sent with the following XML body:
<?xml version="1.0" encoding="utf-8"?>
<StorageServiceProperties>
<Logging>
<Version>1.0</Version>
<Delete>true</Delete>
<Read>false</Read>
<Write>true</Write>
<RetentionPolicy>
<Enabled>true</Enabled>
<Days>7</Days>
</RetentionPolicy>
</Logging>
<Metrics>
<Version>1.0</Version>
<Enabled>true</Enabled>
<IncludeAPIs>false</IncludeAPIs>
<RetentionPolicy>
<Enabled>true</Enabled>
<Days>7</Days>
</RetentionPolicy>
</Metrics>
<DefaultServiceVersion>2011-08-18</DefaultServiceVersion>
</StorageServiceProperties>
After the request has been sent, the following response is returned:
HTTP/1.1 202 Accepted Connection: Keep-Alive Transfer-Encoding: chunked Date: Tue, 30 Aug 2011 04:28:20 GMT Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-id: cb939a31-0cc6-49bb-9fe5-3327691f2a30 x-ms-version: 2011-08-18
See Also