The Simplest Way to Make AWS Backup and Azure Cosmosdb Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair aws backup and azure cosmosdb to store database copies across two clouds. This workflow exports records from Azure and locks them inside an AWS vault. Multi-cloud setups help teams survive regional outages and meet strict data rules. Neither cloud provider offers a single button to link these two tools directly. Instead, engineers build a middle worker job that moves data on a schedule. This worker reads records from Azure and writes files into AWS storage. Then, AWS takes snapshots

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams pair aws backup and azure cosmosdb to store database copies across two clouds. This workflow exports records from Azure and locks them inside an AWS vault.

Multi-cloud setups help teams survive regional outages and meet strict data rules. Neither cloud provider offers a single button to link these two tools directly. Instead, engineers build a middle worker job that moves data on a schedule. This worker reads records from Azure and writes files into AWS storage. Then, AWS takes snapshots of those files and holds them under vault rules.

How aws backup and azure cosmosdb share permissions and data

Data flows between aws backup and azure cosmosdb through an export pipeline. First, a scheduled runner wakes up and logs in to the Azure database. It uses a scoped Azure identity instead of a permanent master key. This identity holds read-only permissions for the specific database containers you want to copy.

Next, the runner pulls the document data and formats it into storage files. The runner then logs in to AWS using a federated workload identity role. It writes the exported files into a staging bucket or file volume. Once the upload finishes, AWS Backup runs a scheduled job on that target. It moves the snapshot into a secure vault and applies retention rules. Vault locks stop anyone from deleting the backup before the timer expires.

Common failure modes and how to scope roles

Many teams make mistakes when they first wire these two clouds together. The biggest risk comes from using shared master keys inside worker scripts. In Azure, master keys grant full control over every container in the account. If a script leaks that key, an attacker can wipe your live data. Over-broad AWS roles create a similar risk on the storage side. A leaked token with admin rights lets an attacker delete your saved vaults.

Unlogged database reads also cause major headaches during security audits. When five scripts share one account, your logs show one generic user name. You cannot tell which job or engineer read a sensitive table. Network paths often stay too open across public internet routes as well.

You can fix these gaps by tightening roles and network rules on both sides. Give your export worker a custom read-only role in Azure. Scope that role down to the exact containers needed for the daily backup. In AWS, separate the role that uploads data from the role that manages vaults. Never let the upload worker delete snapshots or change vault lock timers.

AWS IAM Policies + Azure RBAC: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You should also protect sensitive fields when engineers inspect backup staging data. Data masking rewrites matched fields like emails, phone numbers, card numbers, or national IDs in results. Finally, restrict network traffic to known private links or fixed IP addresses. Drop any public requests that come from outside your approved worker subnet.

Testing your recovery workflow

Saving files in a second cloud only helps if you can restore them. Teams often build an export pipeline and never test the reverse path. A broken script might write empty files into your vault for months. You will only find out when an outage hits your live app.

Run a restore drill every month into a clean test database account. Pull a snapshot from your AWS vault and unpack the exported files. Use a separate write-enabled Azure role to load the records into the test container. Check row counts and sample documents to confirm the data matches production. Log every step of the restore test so auditors can verify your readiness. Drop the temporary test container once the check passes to save cloud costs.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Can AWS Backup pull data directly from Azure CosmosDB?

No, AWS Backup only reads native AWS storage resources and on-premises workloads. You must export your Azure records to an AWS storage resource first.

How should the export job log in to both clouds?

Use workload identity federation so your runner exchanges short-lived tokens between clouds. Avoid storing static Azure master keys or long-lived AWS keys in scripts.

How do we protect personal data during restore tests?

Apply data masking during queries to rewrite emails, phone numbers, and card numbers. This keeps real user details safe while engineers verify the restored tables.

The query runs. The emails stay hidden.