The Simplest Way to Make Azure App Service and Cloud SQL Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair azure app service and cloud sql to run web apps across two clouds. The web app runs on Microsoft servers and reads data from Google databases. This cross-cloud setup lets developers use their favorite tools on both sides. Still, linking two cloud providers creates network and identity gaps that need careful planning. How azure app service and cloud sql share data and roles When your web app starts, it needs a safe path to the database. Traffic leaves the Microsoft network and trav

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 pair azure app service and cloud sql to run web apps across two clouds. The web app runs on Microsoft servers and reads data from Google databases.

This cross-cloud setup lets developers use their favorite tools on both sides. Still, linking two cloud providers creates network and identity gaps that need careful planning.

How azure app service and cloud sql share data and roles

When your web app starts, it needs a safe path to the database. Traffic leaves the Microsoft network and travels to the Google network. Teams often set up a site-to-site VPN or private link between the two clouds. This keeps database traffic off the public internet.

Next, the web app must log in to the database. Cloud SQL for PostgreSQL is a managed database service. Because it is managed, customers cannot create or use accounts with true superuser attributes. A system account managed by Google holds the actual superuser rights on the database. Customers cannot delete or change these system roles or users.

Instead, Google gives you a default admin user created without a password. You must set a password before you log in with that default account. That default account belongs to a special cloud superuser role. This role can create users, create databases, and log in. It can also add extensions, event triggers, and replication rules, but lacks full superuser rights.

Your web app should never log in with that default admin role. Instead, use the admin role once to create a smaller app role. Grant this new role permission to read and write only specific app tables.

Common failure modes in cross-cloud database setups

The biggest mistake teams make is sharing one static database password across many apps. Developers often paste the admin password into the app settings panel. If a person leaves the team, rotating that shared password can break live apps. Worse, every app and developer looks the same inside the database logs.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another failure mode comes from broad network rules. Since Azure web apps can change outbound IP addresses, teams sometimes allow all public IPs. This exposes the database login port to the entire internet. Always lock down outbound traffic with a fixed IP or a private cross-cloud tunnel.

Human access during an incident creates a third risk. When a bug hits production, engineers often grab the web app credentials to run fixes. These unlogged queries can change or expose sensitive rows like emails and phone numbers. If a query returns card numbers or national IDs, you need strict controls in place. Data masking rewrites matched fields in results so raw values do not leak into logs.

Scoping permissions and network paths for safer operations

To keep this setup safe, separate machine traffic from human traffic. Give each web app its own database user with narrow table rights. Do not give the web app permission to drop tables or create new users.

Keep your network path tight as well. Route the web app through a virtual network with a known IP range. Tell the Google firewall to accept traffic only from that exact range. Require encrypted connections for every login attempt across the wire.

Finally, stop engineers from using the web app credentials for manual database work. Give every developer an individual identity tied to your central login provider. Track every query by person, and review admin actions on a regular schedule.

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

Should my web app use the default Cloud SQL admin account?

No, the default admin role has broad rights to create databases and roles. Create a separate database user that can only read and write your specific app tables.

Can I get full PostgreSQL superuser rights in Cloud SQL?

No, Google keeps true superuser rights on a system account that customers cannot modify. You use a managed cloud superuser role for tasks like adding extensions or replication.

How do I stop public internet traffic between Azure and Google Cloud?

Place your web app inside a virtual network and build a cross-cloud VPN tunnel. Then set your database firewall to allow traffic only from that private network range.

The query runs. The emails stay hidden.