The Simplest Way to Make Azure App Service and Cloud Run Work Like They Should
Running azure app service and cloud run together lets teams split workloads across two clouds. Web apps on Azure call Google containers using short-lived identity tokens. This setup avoids static keys in app settings. Teams keep their dot-net or web apps in Azure. At the same time, they run bursty worker jobs on Google Cloud. Both sides talk over HTTPS with strict role checks. This design cuts down on key leaks and manual secret rotation. How identity and data flow between azure app service a
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.
Running azure app service and cloud run together lets teams split workloads across two clouds. Web apps on Azure call Google containers using short-lived identity tokens.
This setup avoids static keys in app settings. Teams keep their dot-net or web apps in Azure. At the same time, they run bursty worker jobs on Google Cloud. Both sides talk over HTTPS with strict role checks. This design cuts down on key leaks and manual secret rotation.
How identity and data flow between azure app service and cloud run
To link these two platforms, you start with managed identities in Azure. Each web app gets its own unique identity in Microsoft Entra. When the Azure app needs to call a worker, it asks for a token. Azure issues a signed OpenID Connect token for that specific app.
Next, the Azure app sends that token to Google Workload Identity Federation. Google checks the token signature against Microsoft public keys. If the check passes, Google trades the Azure token for a temporary Google token. The Azure app then calls the Cloud Run URL with this new token.
On the receiving side, the Google service checks the caller identity before running code. You assign the invoker role only to that single federated identity. Data flows back and forth over encrypted TLS channels. If the service returns sensitive records, data masking rewrites matched fields like emails or card numbers in results. Neither side ever stores a static password or JSON key file on disk.
Common failure modes and how to scope roles
Many teams take shortcuts when they first link two clouds. The most common mistake is downloading a Google service account key file. Engineers paste that raw key into Azure app settings to save time. If someone reads the app settings, they can use that key from anywhere.
Another common issue is sharing one identity across ten different web apps. When a bad query hits a worker, logs only show the shared account name. Your team cannot tell which Azure app or user triggered the call. Broad network settings also cause problems when teams leave services open to all public traffic.
Service-to-Service Authentication + Azure RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix this, give every Azure app its own distinct managed identity. Map each identity to a separate principal in your Google project. Grant the invoker permission on one specific Cloud Run service, not the whole project. Set up ingress controls so the container only accepts traffic from trusted network paths. Make sure both clouds write detailed request logs with trace headers. This lets your team trace every call from the web frontend to the container.
Managing database and service calls during incidents
Even with good service-to-service trust, engineers still need to inspect live apps during outages. A developer might need to check a container state or query a backing database. Opening network ports or handing out cloud admin roles for debugging breaks your security model.
Instead, keep human debugging separate from machine identities. Require engineers to log in with their own work accounts before running commands. Scope every session to the exact task and log every action for review. This keeps your cross-cloud setup clean and auditable at all times.
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
Do I need a static Google JSON key in Azure App Service?
No, you should avoid static JSON keys. Use Azure Managed Identity with Google Workload Identity Federation to trade short-lived tokens instead.
How do I restrict which Azure app can call my Cloud Run service?
Remove public access on the Google side and require login checks. Grant the Cloud Run Invoker role only to the specific federated Azure identity.
How can teams trace requests across both cloud platforms?
Pass a standard trace context header in the HTTPS request from Azure. Both platforms will log the same trace ID so you can match records.
Related guides
In this post