The Simplest Way to Make Azure Functions and Cloud Run Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use azure functions and cloud run together to run multi-cloud workloads. An event in Azure triggers a function that calls a container in Google Cloud. This setup lets your team use the best tools from both clouds. You can process queue messages in Azure and run heavy web apps in Google Cloud. Getting the two platforms to talk safely takes careful planning. You must link identities, lock down network paths, and log every request. How identity and data flow between azure functions and clo

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 functions and cloud run together to run multi-cloud workloads. An event in Azure triggers a function that calls a container in Google Cloud.

This setup lets your team use the best tools from both clouds. You can process queue messages in Azure and run heavy web apps in Google Cloud. Getting the two platforms to talk safely takes careful planning. You must link identities, lock down network paths, and log every request.

How identity and data flow between azure functions and cloud run

Data moves between these two services over standard HTTPS web requests. An Azure event wakes up your function and passes in a payload. The function formats this data and sends it to the Google Cloud endpoint. The container processes the payload and returns a status code to Azure.

Identity is the hardest part of this cross-cloud data flow. You should not put static Google service account keys inside Azure app settings. Instead, set up workload identity federation between Azure and Google Cloud. First, give your Azure function a managed identity in its own cloud. When the function runs, it asks Azure for an identity token. Next, the function sends that Azure token to Google Cloud. Google checks the token and trades it for a short-lived Google token. Finally, the function uses that temporary token to call the container endpoint. No static keys ever sit in your code or settings.

Common failure modes and how to scope roles

Many teams make mistakes when they link two different cloud platforms. The most common failure is using one shared service account for every app. If an attacker steals that one key, they can reach all your services. Another big mistake is leaving the Google Cloud endpoint open to the public. Teams also fail to log the exact data that moves across clouds. Without good logs, you cannot trace bugs or audit who read sensitive records.

You can fix these gaps by scoping down roles and network paths. Give each Azure function its own unique managed identity. Map each Azure identity to a single Google service account. Grant that Google account permission to invoke only one specific container service. Do not grant broad project editor or owner roles to these accounts. On the network side, block public internet traffic where you can. Route cross-cloud traffic through private virtual networks or strict firewall rules. If payloads hold PII like emails or card numbers, mask those fields in logs.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

How to handle timeouts and retries across clouds

Cross-cloud calls travel further across the network than single-cloud calls. Cold starts on either platform can also add seconds to a request. If a container takes too long to start, the calling function may time out. Set your function timeout higher than the worst-case container start time.

Network drops will happen between Azure and Google Cloud from time to time. Build retry logic with backoff into your Azure function code. Make sure your container app handles duplicate requests without breaking data. Use a unique request ID in the header of every cross-cloud call. Write that same request ID into the logs on both cloud platforms. This simple step helps your team trace a single event from start to finish.

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 can an Azure function call Google Cloud without static keys?

Use workload identity federation between Azure and Google Cloud. Your Azure managed identity trades its local token for a temporary Google token.

How do we stop public traffic from hitting our Cloud Run app?

Turn on ingress rules to restrict where network traffic can come from. Require valid IAM identity tokens on every incoming request to the container.

What happens if the Cloud Run container scales to zero?

The next call from Azure will wait while Google starts a new container. Set a minimum instance count in Google Cloud if you need fast replies.

The query runs. The emails stay hidden.