问题描述
我正在使用标题从PowerShell创建数据库:
$ header = @ {authorization = $ authHeader;" x-ms-version" = $ DocumentDBApi;" x-ms-date" = $ dateTime;" x-ms-offer-throughput" = $ ProvisionThroughputRU }
然后我尝试添加将使用数据库吞吐量的集合: / p>
$ header = @ {authorization = $ authHeader;" x-ms-version" = $ DocumentDBApi;" x -ms-date" = $ dateTime;" Accept" =" application / json"}
脚本失败:远程服务器返回错误:(400)错误请求。
在没有x-ms-offer-throughput" = $ ProvisionThroughputRU并使用它进行集合的情况下创建数据库时脚本正常工作。
$ databaseHeader = @ {authorization = $ authHeader;" x-ms-version" = $ DocumentDBApi;" x-ms-date" = $ dateTime}
$ collectionHeader = @ {authorization = $ authHeader;英寸×毫秒的版本" = $ DocumentDBApi;英寸×毫秒的日期与QUOT; = $日期时间;"同意] ="应用/ JSON英寸;英寸×-MS-提供通量" = $ ProvisionThroughputRU }
如何:创建将使用数据库吞吐量的集合?
I am creating database from PowerShell with header:
$header = @{authorization=$authHeader;"x-ms-version"=$DocumentDBApi;"x-ms-date"=$dateTime;"x-ms-offer-throughput"=$ProvisionThroughputRU }
Then I am trying to add collection that will use throughput of the database:
$header = @{authorization=$authHeader;"x-ms-version"=$DocumentDBApi;"x-ms-date"=$dateTime;"Accept"="application/json"}
The script fails with: The remote server returned an error: (400) Bad Request.
The script works fine when database is created without x-ms-offer-throughput"=$ProvisionThroughputRU and collection with it.
$databaseHeader = @{authorization=$authHeader;"x-ms-version"=$DocumentDBApi;"x-ms-date"=$dateTime}
$collectionHeader = @{authorization=$authHeader;"x-ms-version"=$DocumentDBApi;"x-ms-date"=$dateTime;"Accept"="application/json";"x-ms-offer-throughput"=$ProvisionThroughputRU }
How to: create collection that will use throughput of database?
这篇关于从PowerShell创建集合而不提供吞吐量(共享数据库吞吐量)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!