The Simplest Way to Make Azure Key Vault and Google Compute Engine Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use azure key vault and google compute engine to run apps with central secrets. A virtual machine on Google Cloud reads secrets from Azure without saved passwords. Multi-cloud setups often create hard security challenges for platform teams. Engineers want one safe place to store all API keys and certificates. When workloads run on Google Cloud, they still need those stored values. The best setup uses native identity mapping between the two cloud providers. This lets your virtual machines

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 key vault and google compute engine to run apps with central secrets. A virtual machine on Google Cloud reads secrets from Azure without saved passwords.

Multi-cloud setups often create hard security challenges for platform teams. Engineers want one safe place to store all API keys and certificates. When workloads run on Google Cloud, they still need those stored values. The best setup uses native identity mapping between the two cloud providers. This lets your virtual machines fetch secrets at runtime without static keys on disk.

How azure key vault and google compute engine share trust

The cleanest link between these two platforms uses Workload Identity Federation. You do not need to create or export a static Azure client secret. Instead, each Google Compute Engine instance gets its own Google service account. That service account can request a short-lived OpenID Connect token from Google. The virtual machine sends this signed token to Microsoft Entra ID.

Microsoft Entra ID checks the token against a trust rule you set up. Once the check passes, Azure returns a short-lived Azure token to the machine. The app on the virtual machine uses that token to call the vault. It reads the needed key or certificate over TLS right into memory. Nothing stays on the boot disk of the virtual machine.

Common failure modes and how to scope roles

Many teams start by putting a static Azure client secret on the server. They store this secret inside startup scripts or local text files. Anyone who logs into the server can read that secret. If an attacker steals that key, they can read the whole vault. Shared service accounts make this problem much worse across big fleets. When fifty servers share one identity, you cannot tell which server read a key.

Another common mistake is granting broad vault roles to the server identity. A single app might get read rights to every secret in the vault. Instead, you should use Azure role-based access control at the single secret level. Give each Google service account its own federated identity in Azure. Map that identity only to the exact secrets that one workload needs.

Azure Key Vault + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Network paths between the two clouds also need strict rules. By default, a vault endpoint accepts traffic from any public IP address. You should restrict the vault firewall to known outbound NAT addresses from Google Cloud. For tighter control, route traffic through a private cross-cloud network link. Always turn on diagnostic logs in both clouds so you can trace every read.

Keeping human and machine secret reads separate

Workload federation fixes how apps fetch secrets, but engineers still debug live servers. When an engineer logs into a virtual machine, they can query the metadata server. From there, they can fetch the same Azure token the app uses. To reduce risk, keep human debugging sessions separate from machine runtime identities. Limit who can open a shell on production nodes that hold vault permissions.

You should also mask sensitive values when teams inspect logs or database outputs. For example, data masking rewrites emails, phone numbers, card numbers, and national IDs in results. Combining strict vault roles with clean output rules keeps production data safe during incidents.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How does a Google virtual machine log in to Azure without a password?

The virtual machine uses its Google service account to get a signed OIDC token. Microsoft Entra ID trusts this token and swaps it for an Azure token.

How should we scope vault permissions for multiple Google Cloud apps?

Create a unique Google service account for each app on your virtual machines. Grant each account read rights only to its own specific secrets in Azure.

What happens when the federated token expires on the virtual machine?

The Azure client library requests a fresh OIDC token from the local metadata server. It swaps that token for a new Azure token without stopping the app.

The query runs. The emails stay hidden.