MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.28k stars 21.47k forks source link

Azure Resource Manager Template to create Azure Cosmos DB for Core (SQL) API WITH shared throughput for non free tier accounts #76761

Closed jtwalters25 closed 3 years ago

jtwalters25 commented 3 years ago

[This doc provides templates for deploying Cosmos DB instances and how you can optionally create a parameters json file to use when deploying multiple instances of the same resource with different names and values. However, when customers deploy Cosmos DB instances with shared throughput in the Azure portal and then tries to deploy from exported ARM template, the deployment fails with the following error

'Message: {\'code\':\'BadRequest\',\'message\':\'Message: {\\\'Errors\\\':[\\\'x-ms-cosmos-migrate-offer-to-manual-throughput must be supplied and offercontent must contain autopilotSettings for migration of autoscale collection to manual throughput.\\\']}\\r\\nActivityId: c6abf89f-52ca-47e2-bfe3-7014a6c7472d, Request URI: /apps/9a5f16fe-32d3-43b5-be45-9a0239e9c55f/services/9a70741e-da0e-401a-bc9a-38d86b071f2a/partitions/081d577c-3594-4626-9c53-0111e7239158/replicas/132660414634726210p, RequestStats: \\r\\nRequestStartTime: 2021-06-09T19:36:33.8457171Z, RequestEndTime: 2021-06-09T19:36:33.8457171Z, Number of regions attempted:1\\r\\nResponseTime: 2021-06-09T19:36:33.8457171Z, StoreResult: StorePhysicalAddress: rntbd://10.0.0.19:11000/apps/9a5f16fe-32d3-43b5-be45-9a0239e9c55f/services/9a70741e-da0e-401a-bc9a-38d86b071f2a/partitions/081d577c-3594-4626-9c53-0111e7239158/replicas/132660414634726210p, LSN: 8, GlobalCommittedLsn: 8, PartitionKeyRangeId: , IsValid: True, StatusCode: 400, SubStatusCode: 0, RequestCharge: 0, ItemLSN: -1, SessionToken: -1#8, UsingLocalLSN: False, TransportException: null, BELatencyMs: 0.837, ActivityId: c6abf89f-52ca-47e2-bfe3-7014a6c7472d, ResourceType: Offer, OperationType: PreReplaceValidation\\r\\n, SDK: Microsoft.Azure.Documents.Common/2.14.0\'}, Request URI: /offers/L3CG, RequestStats: , SDK: Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0'

The doc shows how to deploy shared throughput for only Free Tier accounts so people with paid subscriptions get an error unless they manually add the following JSON property to their template: "options": {"throughput": 400}

as shown in the free tier template example code. Creating a shared throughput database and collection from ARM template should be more straightforward. Can we update this doc to reflect how customers (who dont have free teir accounts) can deploy shared a throughput database and collection by adding the property mentioned. Autoscale with shared throughput can also be added to the template like this: "options": {"autoscaleSettings": { "maxThroughput": 4000 }}

]


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

markjbrown commented 3 years ago

There are multiple topics in this issue. I'm going to unpack and address each.

Error exporting template: This GitHub Issues list is only for reporting docs bugs. For runtime errors with the service, please raise a ticket with support. They are much better equipped to diagnose and correct. If the root cause is a bug in the service, they are also able to raise with engineering in order to fix.

Deploying Free Tier account: The ARM template in the article referenced here does include the throughput already so no change necessary here.

Free tier with Autoscale Customers are free to deploy an account marked with free tier if they choose and can optionally provision it with autoscale. However, because autoscale can go up to 4000 RU/s, any consumed throughput above the free 1000 RU/s would no longer be free.

Creating a sample like this would likely cause confusion for customers and would also be somewhat misleading as the account could possibly end up not being entirely free.

If you're looking to create an account with standard or autoscale throughput shared at the database level, simply apply the throughput settings in the Options property for the database resource.

Thanks.

please-close.

jtwalters25 commented 3 years ago

Thanks for the swift response.

The error mentioned is due to the exported template of an account with shared throughput property not being included properly when trying to deploy from that ARM template. That part does seem to need a ticket raised with engineering. I will do raise that ticket.

In resolving this issue with manually modifying the template I found that the doc did not address this specific shared throughput property when using ARM templates for any other account other than free tiers.

This issue is addressing the NON free tiers and or the internal subs

I think this part of what you said is what customers, who aren't on the free tier, would find helpful. I think I was looking to get the doc updated with this being mentioned, doesn't need to be an entire sample code section. "If you're looking to create an account with standard or autoscale throughput shared at the database level, simply apply the throughput settings in the Options property for the database resource."

This isn't to modify the free tier sample, just to highlight how the one property only mentioned in the free tier sample could be helpful if included in the other ARM templates. Autoscale was a parameter the customer wanted to include in their template which wasn't free. I was just highlighting how that options property allows other parameters to be enabled to the customer's benefit if it was highlighted or mentioned in the doc.

Not an attempt to modify whats documented with the free tier ARM template code sample.

markjbrown commented 3 years ago

Hi Jeremiah. I'm not sure I'm clear.

Are you asking that I show or mention a example of shared database throughput with autoscale?

jtwalters25 commented 3 years ago

Hi Mark,

I am requesting, if its possible, to mention "If you're looking to create an account with standard or autoscale throughput shared at the database level, simply apply the throughput settings in the Options property for the database resource."

seems straightforward enough, an example may not be necessary.

Thanks for your consideration

markjbrown commented 3 years ago

I included a sentence with the other Important notes near the top of this article. Should merge Monday morning.

Thanks.