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

Published
Length
3 min read

Luis Felipe Dias

All posts

Using azure app service and step functions lets web apps trigger cross-cloud state machines. The web app handles user requests while the state machine runs multi-step background tasks. Teams often host their web front end in Microsoft's cloud for identity features. At the same time, they run data tasks in Amazon's cloud. Linking these two tools requires safe login methods and strict network rules. Without a good setup, teams end up sharing static keys that are hard to track. How azure app ser

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.

Using azure app service and step functions lets web apps trigger cross-cloud state machines. The web app handles user requests while the state machine runs multi-step background tasks.

Teams often host their web front end in Microsoft's cloud for identity features. At the same time, they run data tasks in Amazon's cloud. Linking these two tools requires safe login methods and strict network rules. Without a good setup, teams end up sharing static keys that are hard to track.

How azure app service and step functions exchange data and identity

To make these services talk, you must first build trust between both clouds. The web app needs a managed identity from its host cloud platform. This identity issues a signed web token when the app starts a job. The app sends this token to the target cloud to trade it for temporary access.

Once the target cloud checks the token, it grants a short-lived role to the app. The web app can now call the state machine endpoint over a secure link. It sends a small payload with job details, such as order IDs or user profiles. If the payload holds emails or phone numbers, masking rewrites matched fields in results.

The state machine can also call back to the web app when a job ends. In this direction, the state machine uses an execution role to sign an outgoing request. The web app checks the request headers and updates its local database with the final status. This two-way pattern keeps both platforms in sync without manual work.

Fixing common failure modes across cloud boundaries

Many teams start by putting long-lived cloud keys inside the web app settings. This habit creates a big risk if someone steals the app settings. Shared service accounts also make it impossible to see which user triggered a specific workflow. If a job fails or leaks data, the security team hits a dead end.

Broad permissions cause another major problem in cross-cloud setups. An admin might allow the web app to start every state machine in the account. Instead, you must scope the target role to one specific workflow resource. The web app should only have the right to start and check that single workflow.

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 timeouts also break cross-cloud calls if you leave them at default values. Web apps expect fast replies, while state machines can run for hours or days. Set the web app to trigger asynchronous runs and return a tracking ID right away. Route traffic over private cloud links or restrict calls to known outbound IP addresses.

Keeping cross-cloud audit logs and data safe

When a job crosses two clouds, tracking a single user action becomes very hard. Each cloud writes logs in its own format and stores them in separate places. You should generate a unique trace ID inside the web app for every user request. Pass this trace ID inside the state machine input so both logs share it.

Pay close attention to what gets recorded in the state machine execution history. State machines log the full input and output of every single step by default. If your app sends card numbers or national IDs, those values sit in plain text. Scrub or mask sensitive fields before they enter the workflow state history.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

How do I connect these two services without static access keys?

Use workload identity federation between the two cloud providers. The web app trades its local managed identity token for a temporary cross-cloud role.

Should the web app wait for the state machine to finish?

No, long workflows will cause web requests to time out and fail. Start the workflow in the background and use a webhook or polling to check status.

How can I protect sensitive data in workflow execution logs?

Keep raw PII out of the state payload by passing database record IDs instead. You can also apply data masking so emails or card numbers get rewritten in logs.

The query runs. The emails stay hidden.