如何为 Azure Storage Table Set Table Service Properties 端点构造规范资源?

How can I construct canonical resource for Azure Storage Table Set Table Service Properties endpoint?

Azure 向 set table service properties. This endpoint expects client to pass Authorization header and that could be formatted as SharedKeyLite <account-name>:<signature> for Table services as explained here 公开了一个端点。 signature<date>\n<canonical-resource> 的 sha256 编码形式,规范资源构建遵循以下规则:

  1. Beginning with an empty string (""), append a forward slash (/), followed by the name of the account that owns the resource being accessed.
  2. Append the resource's encoded URI path. If the request URI addresses a component of the resource, append the appropriate query string. The query string should include the question mark and the comp parameter (for example, ?comp=metadata). No other parameters should be included on the query string.

根据 Authentication documentation.

我可以为 query tables or entity operations 进行身份验证。但是,我一直无法验证集 table 服务属性端点。 我根据 规则 1 从 "/<account-name>" 开始构建规范资源 然后我追加另一个没有任何查询字符串的 "/",因为我相信请求 URI(https://<account-name>.table.core.windows.net/?restype=service&comp=properties)没有根据 规则 2[= 寻址组件41=]。这使得规范资源 "/<account-name>/".

是否有人设法对此端点进行身份验证?如果有怎么办?

注意 1:我尝试了其他方式(也附加了查询字符串,这使得规范资源 "/<account-name>/?comp=properties"),但再次失败。

注意 2:规则 2 要求附加编码的 URI 路径,但事实并非如此。

我能够部分解决问题。问题是 Azure 存储模拟器的行为与实际存储服务不同。 Set Table Service Properties 端点未在模拟器上验证请求,而它在服务本身上正常通过。针对 table(读取、创建、删除)和实体(创建、读取、更新和删除)的其他请求在模拟器和服务上的行为相同。

规范资源的格式为"/<account-name>/?comp=properties"。正如预期的那样,内容类型对身份验证没有影响。