The Simplest Way to Make AWS CloudFormation and Azure Storage Work Like They Should
Teams use aws cloudformation and azure storage together to manage cross-cloud backups and state files. You set up CloudFormation custom resources that talk to Azure containers through federated identities. Multi-cloud setups often create messy manual steps for platform teams. One team builds stacks in AWS while another team stores files in Azure. You can link both systems without copying static storage keys across clouds. This guide shows how to link them with tight rules and clear logs. How
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 use aws cloudformation and azure storage together to manage cross-cloud backups and state files. You set up CloudFormation custom resources that talk to Azure containers through federated identities.
Multi-cloud setups often create messy manual steps for platform teams. One team builds stacks in AWS while another team stores files in Azure. You can link both systems without copying static storage keys across clouds. This guide shows how to link them with tight rules and clear logs.
How aws cloudformation and azure storage share identity and data
AWS CloudFormation runs stacks inside your AWS account using an execution role. It cannot create or read an Azure container with its default resource types. To bridge the gap, you add a custom resource backed by a serverless function. That function runs during stack creation, updates, and deletion.
Your function needs a safe way to log in to Azure. Do not put an Azure storage account key inside your stack parameters. Instead, set up workload identity federation between your AWS role and Azure. The function requests a signed web token from AWS. It trades that token with the Azure identity service for temporary permissions. Then the function creates the container or writes data to Azure.
Common failure modes and how to scope roles
Many teams start by sharing a single storage account key across several stacks. If one developer reads the stack outputs, that key is exposed. Broad tokens also allow any stack to delete containers owned by other apps. Unlogged calls make it hard to see which stack changed a file.
You can fix this by giving each stack its own AWS role. Map each AWS role to a specific Azure role on one container. Grant read or write permissions only for the paths that stack needs. Avoid giving full account owner rights to a deployment role.
AWS IAM Policies + Azure RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Network paths between the two clouds also need tight controls. By default, calls from your AWS function travel over the public internet. Set up IP firewall rules on the Azure storage side to restrict traffic. Allow traffic only from your known AWS outbound network addresses. Turn on storage logs in Azure and stack event logs in AWS. When a deployment fails, you can check both logs to find the blocked call.
Managing state drift and stack updates
Cross-cloud resources can drift when someone edits Azure settings outside of AWS. If an engineer deletes a container in Azure, CloudFormation does not know right away. The next stack update will fail when the custom function tries to read it.
Write your custom function so it checks if the container exists first. Make every create, update, and delete step safe to run more than once. Set clear retention rules on your Azure blobs before the stack finishes. If a stack rolls back, decide whether the function should keep or remove data. Keeping production data safe during a rollback prevents accidental loss. Test your rollback flow in a sandbox account before running it in production.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can AWS CloudFormation manage Azure resources without third-party tools?
Yes, you can use CloudFormation custom resources or private registry types. These run a small function in AWS that calls the Azure REST API directly.
How do I avoid storing Azure keys in AWS templates?
Use OpenID Connect federation between AWS IAM and Microsoft Entra ID. Your AWS role exchanges its identity token for a short-lived Azure token at runtime.
What happens to Azure files when a CloudFormation stack is deleted?
Your custom resource function decides what happens on stack deletion. You can write the function to either keep the container or delete it.
Related guides
In this post