|
| 1 | +--- |
| 2 | +reviewed: 2024-05-01 |
| 3 | +severity: Important |
| 4 | +pillar: Reliability |
| 5 | +category: RE:04 Target metrics |
| 6 | +resource: Cosmos DB |
| 7 | +online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.Cosmos.SLA/ |
| 8 | +--- |
| 9 | + |
| 10 | +# Use paid tier for production workloads |
| 11 | + |
| 12 | +## SYNOPSIS |
| 13 | + |
| 14 | +Use a paid tier to qualify for a Service Level Agreement (SLA). |
| 15 | + |
| 16 | +## DESCRIPTION |
| 17 | + |
| 18 | +Cosmos DB offers one account on selected subscriptions to be marked to use a free tier allowance of 1000 DTUs. |
| 19 | +This free tier is intended for developers to try Cosmos DB during early development and proof of concepts (PoC). |
| 20 | +Using the free tier offer is not intended to be used for production level workloads. |
| 21 | + |
| 22 | +When using the free tier, the SLA for Cosmos DB does not apply. |
| 23 | + |
| 24 | +## RECOMMENDATION |
| 25 | + |
| 26 | +Consider using a paid SKU to qualify for a Service Level Agreement (SLA). |
| 27 | + |
| 28 | +## EXAMPLES |
| 29 | + |
| 30 | +### Configure with Azure template |
| 31 | + |
| 32 | +To deploy Cosmos DB accounts that pass this rule: |
| 33 | + |
| 34 | +- Set the `properties.enableFreeTier` property to `false` or do not configure the property. |
| 35 | + |
| 36 | +For example: |
| 37 | + |
| 38 | +```json |
| 39 | +{ |
| 40 | + "type": "Microsoft.DocumentDB/databaseAccounts", |
| 41 | + "apiVersion": "2023-04-15", |
| 42 | + "name": "[parameters('name')]", |
| 43 | + "location": "[parameters('location')]", |
| 44 | + "properties": { |
| 45 | + "enableFreeTier": false, |
| 46 | + "consistencyPolicy": { |
| 47 | + "defaultConsistencyLevel": "Session" |
| 48 | + }, |
| 49 | + "databaseAccountOfferType": "Standard", |
| 50 | + "locations": [ |
| 51 | + { |
| 52 | + "locationName": "[parameters('location')]", |
| 53 | + "failoverPriority": 0, |
| 54 | + "isZoneRedundant": true |
| 55 | + } |
| 56 | + ], |
| 57 | + "disableKeyBasedMetadataWriteAccess": true |
| 58 | + } |
| 59 | +} |
| 60 | +``` |
| 61 | + |
| 62 | +### Configure with Bicep |
| 63 | + |
| 64 | +To deploy Cosmos DB accounts that pass this rule: |
| 65 | + |
| 66 | +- Set the `properties.enableFreeTier` property to `false` or do not configure the property. |
| 67 | + |
| 68 | +For example: |
| 69 | + |
| 70 | +```bicep |
| 71 | +resource account 'Microsoft.DocumentDB/databaseAccounts@2023-04-15' = { |
| 72 | + name: name |
| 73 | + location: location |
| 74 | + properties: { |
| 75 | + enableFreeTier: false |
| 76 | + consistencyPolicy: { |
| 77 | + defaultConsistencyLevel: 'Session' |
| 78 | + } |
| 79 | + databaseAccountOfferType: 'Standard' |
| 80 | + locations: [ |
| 81 | + { |
| 82 | + locationName: location |
| 83 | + failoverPriority: 0 |
| 84 | + isZoneRedundant: true |
| 85 | + } |
| 86 | + ] |
| 87 | + disableKeyBasedMetadataWriteAccess: true |
| 88 | + } |
| 89 | +} |
| 90 | +``` |
| 91 | + |
| 92 | +## LINKS |
| 93 | + |
| 94 | +- [RE:04 Target metrics](https://learn.microsoft.com/azure/well-architected/reliability/metrics) |
| 95 | +- [Try Azure Cosmos DB free](https://learn.microsoft.com/azure/cosmos-db/try-free) |
| 96 | +- [Azure Cosmos DB pricing](https://azure.microsoft.com/pricing/details/cosmos-db/autoscale-provisioned/) |
| 97 | +- [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.documentdb/databaseaccounts) |
0 commit comments