The Simplest Way to Make Azure Service Bus and Step Functions Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use azure service bus and step functions to run tasks across two clouds. Azure queues hold messages while AWS state machines run each job step in order. Many groups run apps in both Microsoft and Amazon clouds at the same time. A core app in Azure might write an order event to a queue. Then a workflow in AWS needs to read that event and process the order. Linking these two tools lets you build one clear flow across both clouds. How azure service bus and step functions move data The dat

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 service bus and step functions to run tasks across two clouds. Azure queues hold messages while AWS state machines run each job step in order.

Many groups run apps in both Microsoft and Amazon clouds at the same time. A core app in Azure might write an order event to a queue. Then a workflow in AWS needs to read that event and process the order. Linking these two tools lets you build one clear flow across both clouds.

How azure service bus and step functions move data

The data flow between azure service bus and step functions relies on small worker tasks. Step Functions cannot pull messages from an Azure queue on its own. Instead, a message arrives in the Azure queue first. A small compute task reads that message and starts the AWS state machine. The state machine can also call an AWS function to send messages back to Azure.

Identity trust is the best way to handle logins between the two clouds. In the past, teams put long-lived Azure keys inside AWS secret stores. Today, you can set up workload identity federation between AWS and Azure. The AWS worker task trades its native role token for a short Azure token. Azure checks the token and lets the task read or write to the queue.

You should keep permissions tight on both sides of the link. Give the Azure identity only the right to send or read on one queue. Do not grant full admin rights over the whole messaging namespace. On the AWS side, let the trigger task start only one specific state machine.

Common failure modes and how to fix them

Shared service accounts cause big trouble when linking queues and state machines. If ten workflows share one Azure key, you cannot tell which app sent bad data. Also, rotating that single key can break all ten workflows at the same time. Give each workflow its own identity and its own scoped role.

Message lock timeouts are another common trap in cross-cloud setups. When a worker reads an Azure message, the queue hides it for a short time. If the AWS workflow takes too long, the lock expires and the message shows up again. Another worker then reads the same message and starts a duplicate workflow run. To fix this, either finish the start step fast or renew the lock on time.

Service-to-Service Authentication + Azure RBAC: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Network paths and retry rules also need care. Calls across two clouds travel over the public web or private peering links. Short network drops will happen from time to time. Both Azure queues and AWS state machines have built-in retry rules. If both sides retry at once without a unique message ID, you get duplicate work. Pass a clear message ID so the state machine can spot and skip repeats.

Auditing and protecting payload data

Unlogged payloads make it hard to fix broken runs across two clouds. When a state machine fails, engineers often inspect the raw input and output JSON. Those payloads might hold sensitive user fields like emails, phone numbers, or card numbers. If every developer can read full state history in AWS, private data gets exposed.

You should strip or mask sensitive fields before they enter state machine logs. Masking rewrites matched fields in results so emails or national IDs do not sit in plain text. Keep a clear audit trail of who reads dead-letter queues or runs manual retries. Good logs show the user identity, the time, and the exact action taken.

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 Step Functions read from Azure Service Bus directly?

No, Step Functions needs a small helper function or connector to poll the Azure queue. That helper reads the message and calls the AWS API to start the state machine.

How do I avoid storing static Azure keys in AWS?

Use workload identity federation between your AWS role and Microsoft Entra ID. The AWS task swaps its native token for a short Azure access token at run time.

How do I stop duplicate state machine runs when a queue retries?

Use the unique message ID from the Azure queue as the Step Functions run name. AWS will reject a second start call that uses the same run name.

The query runs. The emails stay hidden.