0
votes

I have an existing Cosmos database with many collections. RU is set on the collection level.

I want to update collections RU using Powershell on-demand basis. I tried below command but getting below errors

PS C:\WINDOWS\system32> Get-CosmosDbOffer -Context $cosmosDbContext -Id 'IuX1' |
Set-CosmosDbOffer -Context $cosmosDbContext -OfferThroughput 555 -OfferIsRUPerMinuteThroughputEnabled $true

Invoke-WebRequest : The remote server returned an error: (400) Bad Request. At C:\Program Files\WindowsPowerShell\Modules\CosmosDB\2.1.7.675\lib\utils.ps1:562 char:30 + ... estResult = Invoke-WebRequest -UseBasicParsing @invokeWebRequestParam ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Any suggestion?? I followed below links but same error

https://github.com/PankajRawat333/CosmosDB#working-with-offers https://github.com/PlagueHO/CosmosDB/wiki/Set-CosmosDbOffer

1
I'm not sure about that third party wrapper, but RU/s should be a multiple of 100 (555 doesn't seem a valid value) and RU/m was a preview feature last year that is no longer available.Matias Quaranta

1 Answers

0
votes

I can reproduce your issue, it was caused by -OfferThroughput 555, as mentioned in the comment, the offerThroughput must be in multiple of 100, I test with a value like 500, it works.

enter image description here

See this link - Offers:

enter image description here