The Simplest Way to Make Azure Resource Manager and Step Functions Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use azure resource manager and step functions to build cross-cloud workflows. The AWS state machine calls the Azure API to create or change cloud resources. This setup lets one workflow run tasks across both clouds in a clear order. Engineering teams do not need to write custom glue apps to manage state. How azure resource manager and step functions share identity and data A workflow in AWS must prove its identity before Azure accepts any request. The best way to link them is through wo

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 azure resource manager and step functions to build cross-cloud workflows. The AWS state machine calls the Azure API to create or change cloud resources. This setup lets one workflow run tasks across both clouds in a clear order. Engineering teams do not need to write custom glue apps to manage state.

How azure resource manager and step functions share identity and data

A workflow in AWS must prove its identity before Azure accepts any request. The best way to link them is through workload identity federation. The AWS workflow gets a short token from its local identity provider. It sends this token to Azure Active Directory to ask for access.

Azure checks the token against a trust rule you set up earlier. If the check passes, Azure returns an access token for that single run. The state machine then sends web requests to the Azure API endpoint. Each request carries the Azure token in its header to prove its role.

Data flows back and forth as simple JSON payloads over HTTPS. The state machine sends the desired resource state in the request body. Azure replies with a status code and the current details of the resource. The workflow reads this reply and decides which step to run next.

Long tasks in Azure do not finish right away. The Azure API returns a header that points to a status check URL. The state machine waits on a timer and polls that URL until the job finishes. This polling loop keeps the workflow in sync with Azure without holding open network sockets.

Common failure modes and how to scope roles

Many teams start by putting a static Azure client secret inside AWS storage. This choice creates a big risk because static keys rarely get rotated on time. Multiple workflows often end up sharing the same service account and secret key. When a bad script breaks something, the logs only show that shared account name.

Broad permissions make this problem much worse in daily operations. Teams often give the workflow a full contributor role over the whole Azure subscription. If one state machine has a bug, it can delete resources owned by other teams. A leaked token from that workflow gives an attacker wide control over Azure.

Azure RBAC + Cloud Functions IAM: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged requests and raw payloads also create blind spots for security teams. State machine execution history can store full API replies in plain text. Those replies might hold user emails, phone numbers, card numbers, or national IDs. Anyone who reads the workflow logs could see sensitive fields that were not masked.

You can fix these issues by scoping each workflow to its own role. Create one federated identity in Azure for each distinct state machine in AWS. Assign that identity a custom role limited to one Azure resource group. Allow only the exact actions the workflow needs, such as reading or updating storage.

Managing network paths and payload safety

Network rules also help lock down traffic between the two cloud providers. Azure API endpoints sit on the public internet by default. You can run your AWS tasks inside a private subnet with fixed outbound IP addresses. Then you set up Azure conditional access rules to allow only those IP addresses.

Teams should also clean up the data that passes through workflow states. Keep state payloads small by picking only the status fields your next step needs. Masking rules can rewrite matched fields like emails or card numbers in results. This step keeps sensitive records out of your long-term workflow logs.

Set clear timeouts and retry rules on every step that calls Azure. Network drops or rate limits will happen during busy hours. A good retry rule waits a few seconds and tries the request again. If a step still fails, the workflow should run a clean rollback task.

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

How does Step Functions log in to Azure without static keys?

The workflow uses workload identity federation to trade an AWS token for an Azure token. This setup removes the need to store client secrets in either cloud.

How should a workflow handle slow Azure resource creation?

Build a wait and poll loop inside your state machine definition. The workflow checks the Azure status URL on a timer until the task finishes.

How can teams stop workflows from changing the wrong Azure resources?

Give each state machine its own Azure identity and a tight custom role. Scope that role to a single resource group and only the required actions.

The query runs. The emails stay hidden.