Skip to content

Cosmos DB: Add autoscale, backup policies, and firewall support#1254

Open
MartinWa wants to merge 1 commit into
CompositionalIT:masterfrom
MartinWa:cosmos-db-enhancements
Open

Cosmos DB: Add autoscale, backup policies, and firewall support#1254
MartinWa wants to merge 1 commit into
CompositionalIT:masterfrom
MartinWa:cosmos-db-enhancements

Conversation

@MartinWa
Copy link
Copy Markdown
Contributor

@MartinWa MartinWa commented Apr 28, 2026

This PR closes #354, closes #438, and closes #1253

The changes in this PR are as follows:

  • Add autoscale throughput support via CosmosDb.Autoscale.
  • Add continuous backup retention policy support.
  • Add IP firewall rules and Azure firewall toggle.
  • Fix deployment failures for restored accounts by emitting primary location.
  • Update ARM API versions to 2024-11-15.

I have read the contributing guidelines and have completed the following:

  • Tested my code end-to-end against a live Azure subscription.
  • Updated the documentation in the docs folder for the affected changes.
  • Written unit tests against the modified code that I have made.
  • Updated the release notes with a new entry for this PR.
  • Checked the coding standards outlined in the contributions guide and ensured my code adheres to them.

Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure:

open Farmer
open Farmer.Builders

let myCosmosDb =  cosmosDb {
        name "my-cosmos-account"
        account_name "my-cosmos-account"
        throughput (CosmosDb.Autoscale 4000<CosmosDb.RU>)
        backup_retention CosmosDb.Continuous7Days
        enable_azure_firewall
        add_firewall_rule "203.0.113.0"
        add_containers [
            cosmosContainer {
                name "my-container"
                partition_key [ "/id" ] CosmosDb.Hash
            }
        ]
    }

let deployment = arm {
        add_resource myCosmosDb
    }

- Add autoscale throughput support via CosmosDb.Autoscale.
- Add continuous backup retention policy support.
- Add IP firewall rules and Azure firewall toggle.
- Fix deployment failures for restored accounts by emitting primary location.
- Update ARM API versions to 2024-11-15.
@MartinWa MartinWa force-pushed the cosmos-db-enhancements branch from 9219535 to 1619c04 Compare April 28, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CosmosDB add option for backup retention policy CosmosDB add option for Autoscale throughput CosmosDB should support basic firewall settings

1 participant