Get Blob Service Properties

この操作はGet Blob Service Properties、Storage Analyticsおよびクロスオリジン リソース共有 (CORS) ルールのプロパティを含む、Azure Blob Storage アカウントのプロパティを取得します。

CORS ルールと評価ロジックの詳細については、「 Azure Storage サービスの CORS サポート」を参照してください。

要求

要求は Get Blob Service Properties 次のように指定できます。 HTTPS を使用することをお勧めします。 <account-name> はストレージ アカウントの名前に置き換えます。

Method 要求 URI HTTP バージョン
GET https://<account-name>.blob.core.windows.net/?restype=service&comp=properties HTTP/1.1

注意

ホスト名をパスとクエリ部分から分離するには、URI に常にスラッシュ (/) を含める必要があります。 この操作の場合、URI のパス部分は空です。

URI パラメーター

URI パラメーター 説明
restype=service&comp=properties 必須。 Blob Storage プロパティを取得するには、両方のクエリ文字列の組み合わせが必要です。
timeout 省略可能。 timeout パラメーターは、秒単位で表されます。 詳細については、「 Blob Storage 操作のタイムアウトを設定する」を参照してください。

要求ヘッダー

必須の要求ヘッダーと省略可能な要求ヘッダーを次の表に示します。

要求ヘッダー 説明
Authorization 必須。 承認スキーム、ストレージ アカウント名、および署名を指定します。 詳細については、「Azure Storage への要求を承認する」をご覧ください。
Date または x-ms-date 必須。 要求に対して協定世界時 (UTC) を指定します。 詳細については、「Azure Storage への要求を承認する」をご覧ください。
x-ms-version すべての承認された要求に必要です。 この要求に使用する操作のバージョンを指定します。 詳細については、「Azure Storage サービスのバージョン管理」を参照してください。
x-ms-client-request-id 省略可能。 ログ記録の構成時にログに記録される 1 kibibyte (KiB) 文字制限を使用して、クライアントによって生成された不透明な値を提供します。 このヘッダーを使用して、クライアント側のアクティビティとサーバーが受信する要求を関連付けるよう強くお勧めします。 詳細については、「Azure Blob Storageの監視」を参照してください。

要求本文

[なし] :

Response

応答には、HTTP 状態コード、一連の応答ヘッダー、および応答本文が含まれています。

status code

操作に成功すると、状態コード 200 (OK) が返されます。

応答ヘッダー

この操作の応答には、次のヘッダーが含まれています。 応答に追加の標準 HTTP ヘッダーが含まれる場合もあります。 すべての標準ヘッダーは 、HTTP/1.1 プロトコル仕様に準拠しています

応答ヘッダー 説明
x-ms-request-id サービスに対して行われた要求を一意に識別します。
x-ms-version 応答に使用される操作のバージョンを指定します。 詳細については、「Azure Storage サービスのバージョン管理」を参照してください。
x-ms-client-request-id 要求と対応する応答のトラブルシューティングに使用できます。 このヘッダーの値は、要求に存在し、その値に 1,024 文字以下の ASCII 文字が含まれている場合、ヘッダーの値 x-ms-client-request-id と等しくなります。 ヘッダーが x-ms-client-request-id 要求に存在しない場合、このヘッダーは応答に存在しません。

応答本文

バージョン 2012-02-12 以前では、応答本文の形式は次のとおりです。

<?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>  

バージョン 2013-08-15 の時点では、応答本文の形式は次のとおりです。

  
<?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>  
  

バージョン 2017-07-29 の時点では、応答本文の形式は次のとおりです。

  
<?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>  
  

バージョン 2018-03-28 の時点では、応答本文の形式は次のとおりです。

<?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>  

バージョン 2019-12-12 の時点では、応答本文の形式は次のとおりです。

<?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>  

応答本文の要素を次の表に示します。

要素名 説明
Logging Azure Analytics の Logging 設定をグループ化します。
メトリック Azure Analytics メトリック設定をグループ化 します[メトリック] 設定では、BLOB の時間単位の集計で API 別にグループ化された要求統計の概要が提供されます。
HourMetrics Azure Analytics の HourMetrics 設定をグループ化します。 HourMetrics 設定では、BLOB の時間単位の集計で API ごとにグループ化された要求統計の概要が提供されます。
MinuteMetrics Azure Analytics の MinuteMetrics 設定をグループ化します。 MinuteMetrics 設定によって、BLOB の分単位の要求の統計が示されます。
Version 現在使用中の Storage Analytics のバージョン。
削除 ログ構成にのみ適用されます。 削除要求をログに記録するかどうかを示します。
読み取り ログ構成にのみ適用されます。 読み取り要求をログに記録するかどうかを示します。
書き込み ログ構成にのみ適用されます。 書き込み要求をログに記録するかどうかを示します。
有効 Blob Storage に対してメトリックが有効になっているかどうかを示します。

読み取りアクセスの地理冗長レプリケーションが有効である場合、プライマリ メトリックとセカンダリ メトリックの両方が収集されます。 読み取りアクセス geo 冗長レプリケーションが有効になっていない場合は、プライマリ メトリックのみが収集されます。
IncludeAPIs メトリック構成にのみ適用されます。 メトリックで、呼び出された API 操作の概要統計情報を生成するかどうかを示します。
RetentionPolicy/Enabled Azure Storage に対してアイテム保持ポリシーが有効になっているかどうかを示します。
RetentionPolicy/Days メトリックまたはログ データを保持する日数を示します。 この値より古いデータはすべて削除されます。
DefaultServiceVersion 受信要求のバージョンが指定されていない場合に Blob Storage への要求に使用する既定のバージョンを示します。 値には、バージョン 2008-10-27 以降が含まれます。 該当するバージョンの詳細については、「 Azure Storage サービスのバージョン管理」を参照してください。
Cors すべての CORS ルールをグループ化します。
CorsRule CORS ルールの設定をグループ化します。
AllowedOrigins CORS または "*" を使用して許可される元のドメインのコンマ区切りのリストです ("*" はすべてのドメインを許可します)。
ExposedHeaders CORS クライアントに公開されている応答ヘッダーのコンマ区切りのリストです。
MaxAgeInSeconds クライアント/ブラウザーがプレフライト応答をキャッシュする秒数。
AllowedHeaders クロスオリジン要求の一部として許可されるヘッダーのコンマ区切りリスト。
AllowedMethods 元のドメインによる実行が許可される HTTP メソッドのコンマ区切りのリストです。 Azure Storage の場合、許可されるメソッドは DELETE、GET、HEAD、MERGE、POST、OPTIONS、PUT です。
DeleteRetentionPolicy Azure Delete 設定をグループにします。 Blob Storage にのみ適用されます。
有効 削除された BLOB またはスナップショットが削除操作によって保持されるか、すぐに削除されるかを示します。
日間 削除された BLOB を保持する必要がある日数を示します。 この値より古いデータはすべて完全に削除されます。
StaticWebsite staticwebsite 設定をグループにします。 Blob Storage にのみ適用されます。
StaticWebsite/Enabled 指定したアカウントに対して staticwebsite サポートが有効になっているかどうかを示します。
StaticWebsite/IndexDocument Web サイトのルートまたはサブフォルダー (例: index.html) への要求に対して Azure Storage が提供する Web ページ。 値は、大文字小文字が区別されます。
StaticWebsite/DefaultIndexDocumentPath 既存のファイルに対応しない要求に対して Azure Storage が提供する Web ページへの絶対パス。 ページの内容は、 で HTTP 200 OK 返されます (例: index.html)。 要素は、 と StaticWebsite/IndexDocument相互に排他的です。 値は、大文字小文字が区別されます。
StaticWebsite/ErrorDocument404Path 既存のファイルに対応しない要求に対して Azure Storage が提供する Web ページへの絶対パス。 ページの内容は、 で HTTP 404 Not Found 返されます (例: error/404.html)。 値は、大文字小文字が区別されます。

承認

Azure Storage でデータ アクセス操作を呼び出す場合は、承認が必要です。 以下で説明するように、操作を Get Blob Service Properties 承認できます。

Azure Storage では、Microsoft Entra IDを使用して BLOB データへの要求を承認することがサポートされています。 Microsoft Entra IDでは、Azure ロールベースのアクセス制御 (Azure RBAC) を使用して、セキュリティ プリンシパルにアクセス許可を付与できます。 セキュリティ プリンシパルには、ユーザー、グループ、アプリケーション サービス プリンシパル、または Azure マネージド ID を指定できます。 セキュリティ プリンシパルは、OAuth 2.0 トークンを返すためにMicrosoft Entra IDによって認証されます。 その後、そのトークンを、Blob service に対する要求を認可するために使用できます。

Microsoft Entra IDを使用した承認の詳細については、「Microsoft Entra IDを使用して BLOB へのアクセスを承認する」を参照してください。

アクセス許可

Microsoft Entraユーザー、グループ、またはサービス プリンシパルが操作を呼び出Get Blob Service Propertiesすために必要な RBAC アクションと、このアクションを含む最小限の特権を持つ組み込み Azure RBAC ロールを次に示します。

Azure RBAC を使用したロールの割り当ての詳細については、「 BLOB データにアクセスするための Azure ロールの割り当て」を参照してください。

解説

[なし] : この操作がコストに与える影響の詳細については、 課金情報 を参照してください。

請求

価格要求は、Blob Storage REST API を介して直接、または Azure Storage クライアント ライブラリから Blob Storage API を使用するクライアントから送信できます。 これらの要求では、トランザクションあたりの料金が発生します。 トランザクションの種類は、アカウントの課金方法に影響します。 たとえば、読み取りトランザクションは、書き込みトランザクションとは異なる課金カテゴリに計上されます。 次の表は、ストレージ アカウントの種類に基づく要求の課金カテゴリ Get Blob Service Properties を示しています。

操作 ストレージ アカウントの種類 課金カテゴリ
Get Blob Service Properties Premium ブロック BLOB
Standard 汎用 v2
その他の操作
Get Blob Service Properties Standard 汎用 v1 操作を読み取ります。

指定した課金カテゴリの価格については、「Azure Blob Storage価格」を参照してください。

要求と応答の例

次のサンプル URI は、 myaccount という名前の架空のストレージ アカウントの Blob Storage プロパティを取得する要求を行います。

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

要求は次のヘッダーと共に送信されます。

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

要求が送信された後、次の応答が返されます。

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  

応答には、次の XML 本文が含まれます。

<?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>    
  

こちらもご覧ください

Storage Analytics
Azure Storage サービスの CORS サポート
CORS HTTP の仕様