Get Blob Service Properties

The Get Blob Service Properties operation gets the properties of an Azure Blob Storage account, including properties for Storage Analytics and cross-origin resource sharing (CORS) rules.

For detailed information about CORS rules and evaluation logic, see CORS support for the Azure Storage services.

Request

You can specify the Get Blob Service Properties request as follows. We recommend that you use HTTPS. Replace <account-name> with the name of your storage account:

Method Request URI HTTP version
GET https://<account-name>.blob.core.windows.net/?restype=service&comp=properties HTTP/1.1

Note

The URI must always include a slash (/) to separate the host name from the path and query portions. 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 get the Blob Storage properties.
timeout Optional. The timeout parameter is expressed in seconds. For more information, see Set timeouts for Blob Storage operations.

Request headers

The required and optional request headers are described in the following table:

Request header Description
Authorization Required. Specifies the authorization scheme, storage account name, and signature. For more information, see Authorize requests to Azure Storage.
Date or x-ms-date Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authorize requests to Azure Storage.
x-ms-version Required for all authorized requests. Specifies the version of the operation to use for this request. For more information, see Versioning for the Azure Storage services.
x-ms-client-request-id Optional. Provides a client-generated, opaque value with a 1-kibibyte (KiB) character limit that's recorded in the logs when logging is configured. We highly recommend that you use this header to correlate client-side activities with requests that the server receives. For more information, see Monitor Azure Blob Storage.

Request body

None.

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).

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 Uniquely identifies a request that's made against the service.
x-ms-version Specifies the version of the operation that's used for the response. For more information, see Versioning for the Azure Storage services.
x-ms-client-request-id Can be used to troubleshoot requests and corresponding responses. The value of this header is equal to the value of the x-ms-client-request-id header if it's present in the request and the value contains no more than 1,024 visible ASCII characters. If the x-ms-client-request-id header isn't present in the request, this header isn't present in the response.

Response body

For version 2012-02-12 and earlier, the format of the response 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>  
    <DefaultServiceVersion>default-service-version-string</DefaultServiceVersion>  
</StorageServiceProperties>  

As of version 2013-08-15, the format of the response 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>  
    <HourMetrics>  
        <Version>version-number</Version>  
        <Enabled>true|false</Enabled>  
        <IncludeAPIs>true|false</IncludeAPIs>  
        <RetentionPolicy>  
            <Enabled>true|false</Enabled>  
            <Days>number-of-days</Days>  
        </RetentionPolicy>  
    </HourMetrics>  
    <MinuteMetrics>  
        <Version>version-number</Version>  
        <Enabled>true|false</Enabled>  
        <IncludeAPIs>true|false</IncludeAPIs>  
        <RetentionPolicy>  
            <Enabled>true|false</Enabled>  
            <Days>number-of-days</Days>  
        </RetentionPolicy>  
    </MinuteMetrics>  
    <Cors>  
        <CorsRule>  
            <AllowedOrigins>comma-separated-list-of-allowed-origins</AllowedOrigins>  
            <AllowedMethods>comma-separated-list-of-HTTP-verbs</AllowedMethods>  
            <MaxAgeInSeconds>max-caching-age-in-seconds</MaxAgeInSeconds>  
            <ExposedHeaders>comma-separated-list-of-response-headers</ExposedHeaders>  
            <AllowedHeaders>comma-separated-list-of-request-headers</AllowedHeaders>  
        </CorsRule>  
    </Cors>  
    <DefaultServiceVersion>default-service-version-string</DefaultServiceVersion>  
</StorageServiceProperties>  
  

As of version 2017-07-29, the format of the response 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>  
    <HourMetrics>  
        <Version>version-number</Version>  
        <Enabled>true|false</Enabled>  
        <IncludeAPIs>true|false</IncludeAPIs>  
        <RetentionPolicy>  
            <Enabled>true|false</Enabled>  
            <Days>number-of-days</Days>  
        </RetentionPolicy>  
    </HourMetrics>  
    <MinuteMetrics>  
        <Version>version-number</Version>  
        <Enabled>true|false</Enabled>  
        <IncludeAPIs>true|false</IncludeAPIs>  
        <RetentionPolicy>  
            <Enabled>true|false</Enabled>  
            <Days>number-of-days</Days>  
        </RetentionPolicy>  
    </MinuteMetrics>  
    <Cors>  
        <CorsRule>  
            <AllowedOrigins>comma-separated-list-of-allowed-origins</AllowedOrigins>  
            <AllowedMethods>comma-separated-list-of-HTTP-verbs</AllowedMethods>  
            <MaxAgeInSeconds>max-caching-age-in-seconds</MaxAgeInSeconds>  
            <ExposedHeaders>comma-separated-list-of-response-headers</ExposedHeaders>  
            <AllowedHeaders>comma-separated-list-of-request-headers</AllowedHeaders>  
        </CorsRule>  
    </Cors>  
    <DefaultServiceVersion>default-service-version-string</DefaultServiceVersion>  
    <DeleteRetentionPolicy>
        <Enabled>true|false</Enabled>
        <Days>number-of-days</Days>
    </DeleteRetentionPolicy>
</StorageServiceProperties>  
  

As of version 2018-03-28, the format of the response 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>  
    <HourMetrics>  
        <Version>version-number</Version>  
        <Enabled>true|false</Enabled>  
        <IncludeAPIs>true|false</IncludeAPIs>  
        <RetentionPolicy>  
            <Enabled>true|false</Enabled>  
            <Days>number-of-days</Days>  
        </RetentionPolicy>  
    </HourMetrics>  
    <MinuteMetrics>  
        <Version>version-number</Version>  
        <Enabled>true|false</Enabled>  
        <IncludeAPIs>true|false</IncludeAPIs>  
        <RetentionPolicy>  
            <Enabled>true|false</Enabled>  
            <Days>number-of-days</Days>  
        </RetentionPolicy>  
    </MinuteMetrics>  
    <Cors>  
        <CorsRule>  
            <AllowedOrigins>comma-separated-list-of-allowed-origins</AllowedOrigins>  
            <AllowedMethods>comma-separated-list-of-HTTP-verbs</AllowedMethods>  
            <MaxAgeInSeconds>max-caching-age-in-seconds</MaxAgeInSeconds>  
            <ExposedHeaders>comma-separated-list-of-response-headers</ExposedHeaders>  
            <AllowedHeaders>comma-separated-list-of-request-headers</AllowedHeaders>  
        </CorsRule>  
    </Cors>    
    <DefaultServiceVersion>default-service-version-string</DefaultServiceVersion>
    <DeleteRetentionPolicy>
        <Enabled>true|false</Enabled>
        <Days>number-of-days</Days>
    </DeleteRetentionPolicy>
    <StaticWebsite>
        <Enabled>true|false</Enabled>
        <IndexDocument>default-name-of-index-page-under-each-directory</IndexDocument>
        <ErrorDocument404Path>absolute-path-of-the-custom-404-page</ErrorDocument404Path>
    </StaticWebsite>
</StorageServiceProperties>  

As of version 2019-12-12, the format of the response 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>  
    <HourMetrics>  
        <Version>version-number</Version>  
        <Enabled>true|false</Enabled>  
        <IncludeAPIs>true|false</IncludeAPIs>  
        <RetentionPolicy>  
            <Enabled>true|false</Enabled>  
            <Days>number-of-days</Days>  
        </RetentionPolicy>  
    </HourMetrics>  
    <MinuteMetrics>  
        <Version>version-number</Version>  
        <Enabled>true|false</Enabled>  
        <IncludeAPIs>true|false</IncludeAPIs>  
        <RetentionPolicy>  
            <Enabled>true|false</Enabled>  
            <Days>number-of-days</Days>  
        </RetentionPolicy>  
    </MinuteMetrics>  
    <Cors>  
        <CorsRule>  
            <AllowedOrigins>comma-separated-list-of-allowed-origins</AllowedOrigins>  
            <AllowedMethods>comma-separated-list-of-HTTP-verbs</AllowedMethods>  
            <MaxAgeInSeconds>max-caching-age-in-seconds</MaxAgeInSeconds>  
            <ExposedHeaders>comma-separated-list-of-response-headers</ExposedHeaders>  
            <AllowedHeaders>comma-separated-list-of-request-headers</AllowedHeaders>  
        </CorsRule>  
    </Cors>    
    <DefaultServiceVersion>default-service-version-string</DefaultServiceVersion>
    <DeleteRetentionPolicy>
        <Enabled>true|false</Enabled>
        <Days>number-of-days</Days>
    </DeleteRetentionPolicy>
    <StaticWebsite>
        <Enabled>true|false</Enabled>
        <IndexDocument>default-name-of-index-page-under-each-directory</IndexDocument>
        <DefaultIndexDocumentPath>absolute-path-of-the-default-index-page</DefaultIndexDocumentPath>
        <ErrorDocument404Path>absolute-path-of-the-custom-404-page</ErrorDocument404Path>
    </StaticWebsite>
</StorageServiceProperties>  

The elements of the response body are described in the following table:

Element name Description
Logging Groups the Azure Analytics Logging settings.
Metrics Groups the Azure Analytics Metrics settings. The Metrics settings provide a summary of request statistics, grouped by API in hourly aggregates for blobs.
HourMetrics Groups the Azure Analytics HourMetrics settings. The HourMetrics settings provide a summary of request statistics, grouped by API in hourly aggregates for blobs.
MinuteMetrics Groups the Azure Analytics MinuteMetrics settings. The MinuteMetrics settings provide request statistics for each minute for blobs.
Version The version of Storage Analytics currently in use.
Delete Applies only to logging configuration. Indicates whether delete requests are being logged.
Read Applies only to logging configuration. Indicates whether read requests are being logged.
Write Applies only to logging configuration. Indicates whether write requests are being logged.
Enabled Indicates whether metrics are enabled for Blob Storage.

If read-access geo-redundant replication is enabled, both primary and secondary metrics are collected. If read-access geo-redundant replication isn't enabled, only primary metrics are collected.
IncludeAPIs Applies only to metrics configuration. Indicates whether metrics generate summary statistics for called API operations.
RetentionPolicy/Enabled Indicates whether a retention policy is enabled for the Azure Storage.
RetentionPolicy/Days Indicates the number of days that metrics or logging data is retained. All data that's older than this value will be deleted.
DefaultServiceVersion Indicates the default version to use for requests to Blob Storage if an incoming request’s version isn't specified. Values include version 2008-10-27 and later. For more information about applicable versions, see Versioning for the Azure Storage services.
Cors Groups all CORS rules.
CorsRule Groups settings for a CORS rule.
AllowedOrigins A comma-separated list of origin domains that are allowed via CORS, or "*" if all domains are allowed.
ExposedHeaders A comma-separated list of response headers to expose to CORS clients.
MaxAgeInSeconds The number of seconds that the client/browser should cache a preflight response.
AllowedHeaders A comma-separated list of headers that are allowed to be part of the cross-origin request.
AllowedMethods A comma-separated list of HTTP methods that are allowed to be executed by the origin. For Azure Storage, the permitted methods are DELETE, GET, HEAD, MERGE, POST, OPTIONS, and PUT.
DeleteRetentionPolicy Groups the Azure Delete settings. Applies only to Blob Storage.
Enabled Indicates whether a deleted blob or snapshot is retained or immediately removed by delete operation.
Days Indicates the number of days that a deleted blob should be retained. All data that's older than this value will be permanently deleted.
StaticWebsite Groups the staticwebsite settings. Applies only to Blob Storage.
StaticWebsite/Enabled Indicates whether staticwebsite support is enabled for the specified account.
StaticWebsite/IndexDocument The webpage that Azure Storage serves for requests to the root of a website or any subfolder (for example, index.html). The value is case-sensitive.
StaticWebsite/DefaultIndexDocumentPath The absolute path to a webpage that Azure Storage serves for requests that don't correspond to an existing file. The contents of the page are returned with HTTP 200 OK (for example, index.html). The element is mutually exclusive with StaticWebsite/IndexDocument. The value is case-sensitive.
StaticWebsite/ErrorDocument404Path The absolute path to a webpage that Azure Storage serves for requests that don't correspond to an existing file. The contents of the page are returned with HTTP 404 Not Found (for example, error/404.html). The value is case-sensitive.

Authorization

Authorization is required when calling any data access operation in Azure Storage. You can authorize the Get Blob Service Properties operation as described below.

Important

Microsoft recommends using Microsoft Entra ID with managed identities to authorize requests to Azure Storage. Microsoft Entra ID provides superior security and ease of use compared to Shared Key authorization.

Azure Storage supports using Microsoft Entra ID to authorize requests to blob data. With Microsoft Entra ID, you can use Azure role-based access control (Azure RBAC) to grant permissions to a security principal. The security principal may be a user, group, application service principal, or Azure managed identity. The security principal is authenticated by Microsoft Entra ID to return an OAuth 2.0 token. The token can then be used to authorize a request against the Blob service.

To learn more about authorization using Microsoft Entra ID, see Authorize access to blobs using Microsoft Entra ID.

Permissions

Listed below are the RBAC action necessary for a Microsoft Entra user, group, managed identity, or service principal to call the Get Blob Service Properties operation, and the least privileged built-in Azure RBAC role that includes this action:

To learn more about assigning roles using Azure RBAC, see Assign an Azure role for access to blob data.

Remarks

None. See billing information for details on how this operation affects costs.

Billing

Pricing requests can originate from clients that use Blob Storage APIs, either directly through the Blob Storage REST API, or from an Azure Storage client library. These requests accrue charges per transaction. The type of transaction affects how the account is charged. For example, read transactions accrue to a different billing category than write transactions. The following table shows the billing category for Get Blob Service Properties requests based on the storage account type:

Operation Storage account type Billing category
Get Blob Service Properties Premium block blob
Standard general-purpose v2
Other operations
Get Blob Service Properties Standard general-purpose v1 Read operations

To learn about pricing for the specified billing category, see Azure Blob Storage Pricing.

Sample request and response

The following sample URI makes a request to get Blob Storage properties for a fictional storage account named myaccount:

GET https://myaccount.blob.core.windows.net/?restype=service&comp=properties&timeout=30 HTTP/1.1  

The request is sent with the following headers:

x-ms-version: 2018-03-28
x-ms-date: Tue, 12 Sep 2018 23:38:36 GMT
Authorization: SharedKey myaccount:Z1lTLDwtq5o1UYQluucdsXk6/iB7YxEu0m6VofAEkUE=  
Host: myaccount.blob.core.windows.net

After the request has been sent, the following response is returned:

HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: application/xml
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: cb939a31-0cc6-49bb-9fe5-3327691f2a30  
x-ms-version: 2018-03-28
Date: Tue, 12 Sep 2018 23:38:35 GMT  

The response includes 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>  
    <HourMetrics>  
        <Version>1.0</Version>  
        <Enabled>true</Enabled>  
        <IncludeAPIs>false</IncludeAPIs>  
        <RetentionPolicy>  
            <Enabled>true</Enabled>  
            <Days>7</Days>  
        </RetentionPolicy>  
    </HourMetrics>  
    <MinuteMetrics>  
        <Version>1.0</Version>  
        <Enabled>true</Enabled>  
        <IncludeAPIs>true</IncludeAPIs>  
        <RetentionPolicy>  
            <Enabled>true</Enabled>  
            <Days>7</Days>  
        </RetentionPolicy>  
    </MinuteMetrics>  
    <Cors>  
        <CorsRule>  
            <AllowedOrigins> http://www.fabrikam.com,http://www.contoso.com</AllowedOrigins>  
            <AllowedMethods>GET,PUT</AllowedMethods>  
            <MaxAgeInSeconds>500</MaxAgeInSeconds>  
            <ExposedHeaders>x-ms-meta-data*,x-ms-meta-customheader</ExposedHeaders>  
            <AllowedHeaders>x-ms-meta-target*,x-ms-meta-customheader</AllowedHeaders>  
        </CorsRule>  
    </Cors>  
    <DefaultServiceVersion>2017-07-29</DefaultServiceVersion>
    <DeleteRetentionPolicy>
        <Enabled>true</Enabled>
        <Days>5</Days>
    </DeleteRetentionPolicy>
    <StaticWebsite>  
        <Enabled>true</Enabled>  
        <IndexDocument>index.html</IndexDocument>  
        <ErrorDocument404Path>error/404.html</ErrorDocument404Path>  
    </StaticWebsite>      
</StorageServiceProperties>    
  

See also

Storage Analytics
CORS support for the Azure Storage services
CORS HTTP specification