The Simplest Way to Make Azure VMs and Vertex AI Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You link azure vms and vertex ai by setting up cross-cloud identity federation. This workflow lets apps on Microsoft hosts call Google machine learning models without static keys. Many teams run core backend services on Microsoft cloud virtual machines. At the same time, they want to use Google machine learning models. Linking these two platforms lets your compute instances send prompts and receive model outputs. You do not need to move your whole backend to a new cloud. Instead, you set up a s

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.

You link azure vms and vertex ai by setting up cross-cloud identity federation. This workflow lets apps on Microsoft hosts call Google machine learning models without static keys.

Many teams run core backend services on Microsoft cloud virtual machines. At the same time, they want to use Google machine learning models. Linking these two platforms lets your compute instances send prompts and receive model outputs. You do not need to move your whole backend to a new cloud. Instead, you set up a secure bridge between your virtual machines and the model endpoints.

How identity and data flow between azure vms and vertex ai

To make azure vms and vertex ai work together, start with identity. Each virtual machine in the Microsoft cloud can have its own managed identity. This identity acts like a built-in badge for the server. On the Google side, workload identity federation can check and trust that badge. Your virtual machine requests a local token from its cloud host. Then it trades that token for a short-lived Google token.

Once the server has a valid Google token, the data flow begins. The app on the virtual machine sends an HTTPS request to the model API. This request carries the token in its header and the prompt in its body. Google checks the token and checks the role attached to the federated identity. If the role allows model calls, the service runs the prompt and returns the answer. The whole exchange happens over encrypted traffic between the two cloud providers.

Common failure modes and how to scope roles and network paths

Teams often take shortcuts when they first link two clouds. The most common mistake is downloading a static Google service account key file. Engineers place this JSON file directly on the virtual machine disk. If an attacker reads that disk, they can steal the key and use it anywhere. Static keys also do not expire on their own, which creates long-term risk.

Another common problem is giving the shared identity too much power. Teams often grant broad project editor roles just to make the connection work fast. If one virtual machine gets compromised, the attacker can touch all your cloud resources. Teams also fail when they share one identity across dozens of different servers. When you look at the logs, you cannot tell which server sent a bad query.

You can fix these issues with strict role scoping. Give each app group its own managed identity on the Microsoft side. Map each identity to a narrow Google role that only allows model invocation. Do not grant permission to delete models, read storage buckets, or change project settings. Keep production identities separate from test identities so test servers cannot touch production data.

Azure RBAC + AI Agent Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You should also lock down the network path between the two clouds. By default, calls to the model API travel over the public internet. For better control, set up a private network link or a site-to-site VPN tunnel. Then set up firewall rules on the virtual machine subnet to restrict outbound traffic. Allow traffic only to the specific Google API IP ranges that serve your models. Finally, turn on audit logs in both clouds so you can trace every call. Also consider data masking that rewrites matched fields like emails or card numbers in results.

Managing daily operations across both clouds

Running workloads across two clouds requires clear habits from your engineering team. When a model request fails, you must check two different places to find the cause. First, verify that the virtual machine can reach its local token service. If that step works, check the Google token exchange logs for rejected requests.

Token lifetimes also matter during long batch jobs. A federated token usually lasts for one hour before it expires. Your app logic must refresh this token before it runs out of time. If your app caches an old token, your batch job will fail midway through.

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

Do I need a static service account key on my virtual machine?

No, you should avoid static key files on your server disks. Use workload identity federation so your server trades its native cloud token for temporary access.

How do I keep traffic between the two clouds off the public internet?

You can link your virtual network to Google using a dedicated interconnect or VPN tunnel. Then route your API traffic through private endpoints inside that tunnel.

Why do my model calls fail after running fine for an hour?

Temporary cloud tokens expire after a short period, which is often one hour. Make sure your client code requests a fresh token before the current one expires.

The query runs. The emails stay hidden.