DEV Community

xbill for Google Developer Experts

Posted on • Originally published at xbill999.Medium on

Cross Platform ADK Agents with an Azure Linux VM

This article covers installing and Running Gemini CLI cross-cloud. Azure provides serveral VM options that provide a Linux environment that can support running Gemini CLI.

What is Gemini CLI?

The Gemini CLI is an open-source, terminal-based AI agent from Google that allows developers to interact directly with Gemini models, such as Gemini 2.5 Pro, for coding, content creation, and workflow automation. It supports file operations, shell commands, and connects to external tools via the Model Context Protocol (MCP).

The full details on Gemini CLI are available here:

Build, debug & deploy with AI

What is Azure?

Microsoft Azure is a comprehensive, open, and flexible cloud computing platform provided by Microsoft. It offers over 200 services — including computing, storage, networking, AI, and analytics — that allow users to build, deploy, and manage applications via a global network of datacenters. Azure helps organizations scale infrastructure, innovate with AI, and manage data efficiently, replacing the need for physical, on-premises servers.

Linux Virtual Machines on Azure

Linux Virtual Machines are supported Natively in Azure.

A starter tutorial is available here:

Introduction to Azure virtual machines - Training

Why would I want Gemini CLI on Azure? Isn’t that a Google Thing?

Yes- Gemini CLI leverages the Google Cloud console and Gemini models but it is also open source and platform agnostic. Many applications are already cross-cloud so this enables familiar tools to be run natively on Microsoft Azure.

Activating Azure Console

The Azure Console is available on all Azure Accounts.

To create a new VM- select Virtual Machines/Create. For simplicity a Debian 12 VM is recommended:

Once created — the VM will be visible from the Azure Portal:

Logging Into the VM

There are several ways to access the VM. From a command line — use the key pair and ssh into the instance:

ssh -i azure_key.pem azureuser@20.124.121.35
Enter fullscreen mode Exit fullscreen mode

Node Version Management

Gemini CLI needs a consistent, up to date version of Node. The nvm command can be used to get a standard Node environment:

GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

Verifying Node.js in Azure Cloud Shell

The version of Node.js is verified that it is recent enough to support Gemini CLI:

azureuser@azure-new:~$ node --version
v25.8.0
azureuser@azure-new:~$ npm --version
11.11.0
azureuser@azure-new:~$
Enter fullscreen mode Exit fullscreen mode

Gemini CLI Installation

You can then download the Gemini CLI :

npm install -g @google/gemini-cli
Enter fullscreen mode Exit fullscreen mode

You will see the log messages:

azureuser@azure-new:~$ npm install -g @google/gemini-cli
npm warn deprecated prebuild-install@7.1.3: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
npm warn deprecated glob@10.5.0: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me

changed 618 packages in 1m

173 packages are looking for funding
  run `npm fund` for details
Enter fullscreen mode Exit fullscreen mode

Testing the Gemini CLI Environment

Once you have all the tools and the correct Node.js version in place- you can test the startup of Gemini CLI. You will need to authenticate with a Key or your Google Account:

gemini
Enter fullscreen mode Exit fullscreen mode

Authentication

Several authentication options are available. To use an existing Code Assist licence — authenticate with a Google Account:

> /auth                                                                                                                                                        
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ ? Get started │
│ │
│ How would you like to authenticate for this project? │
│ │
│ ● 1. Login with Google │
│ 2. Use Gemini API Key │
│ 3. Vertex AI │
│ │
│ (Use Enter to select) │
│ │
│ Terms of Services and Privacy Notice for Gemini CLI │
│ │
│ https://geminicli.com/docs/resources/tos-privacy/ │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Enter fullscreen mode Exit fullscreen mode

Then set the GOOGLE_CLOUD_PROJECT to a valid project setup on the Google Cloud console:

~ $ export GOOGLE_CLOUD_PROJECT=comglitn
~ $
Enter fullscreen mode Exit fullscreen mode

Other options include Google Cloud API Key that can be generated directly from the Google Cloud Console.

Using Gemini CLI on Azure Cloud Shell

Once installed- Gemini CLI has direct access to the Cloud Shell environment:

Logged in with Google: xbill@glitnir.com /auth
Plan: Gemini Code Assist Standard

✦ This Azure VM is a Standard_D2s_v3 instance located in the East US region.


  Hardware & System Summary
   - Operating System: Debian 12 (bookworm)
   - CPU: 2 vCPUs (Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz)
   - Memory: 8 GiB RAM
   - Storage: 32 GB OS disk (/dev/sda1), with approximately 22 GB free space.
   - Architecture: x86_64
Enter fullscreen mode Exit fullscreen mode

and Azure operations can be performed directly from Gemini CLI:

> list azure vms using the az command 

✦ The Azure CLI (v2.84.0) is configured with the following account details:


  Azure Account Information
   - User: xbill@glitnir.com
   - Environment: AzureCloud
   - State: Enabled


  Regional Context
   - Location: The VM itself is located in eastus.
   - Top Available Regions: eastus, westus2, australiaeast, southeastasia, northeurope, swedencentral, westeurope, uksouth.


  Technical Profile
   - VM Size: Standard_D2s_v3 (2 vCPU, 8 GB RAM)
   - OS Platform: Debian 12 (bookworm) on a 6.1.x cloud kernel.
Enter fullscreen mode Exit fullscreen mode

Installing Google Cloud Tools

To simplify working with Google Cloud — install the Google Cloud Tools:

https://docs.cloud.google.com/sdk/docs/install-sdk
Enter fullscreen mode Exit fullscreen mode

Once the installation is completed — you can verify the setup:

azureuser@azure-new:~$ gcloud auth list
  Credentialed Accounts
ACTIVE ACCOUNT
* xbill@glitnir.com

To set the active account, run:
    $ gcloud config set account `ACCOUNT`

azureuser@azure-new:~$ gcloud config list
[compute]
region = us-west2
zone = us-west2-a
[core]
account = xbill@glitnir.com
disable_usage_reporting = True
project = comglitn

Your active configuration is: [default]
azureuser@azure-new:~$
Enter fullscreen mode Exit fullscreen mode

Installing Azure Customized GEMINI.md

A sample GitHub repo contains tools for working with Gemini CLI on Azure. This repo is available here:

git clone https://gitHub.com/xbill9/gemini-cli-azure
Enter fullscreen mode Exit fullscreen mode

A sample GEMINI.md customized for the Azure environment is provided in the repo:

This is a multi linux git repo hosted at:
github.com/xbill9/gemini-cli-azure
You are a cross platform developer working with 
Microsoft Azure and Google Cloud
You can use the Azure CLI :
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli
https://learn.microsoft.com/en-us/cli/azure/
https://learn.microsoft.com/en-us/cli/azure/reference
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?view=azure-cli-latest&pivots=apt
## Azure CLI Tools
You can use the Azure CLI to manage resources across Azure Storage, Virtual Machines, and other services.
- **List Resource Groups** : `az group list -o table`
- **List Storage Accounts** : `az storage account list -o table`
- **List Virtual Machines** : `az vm list -d -o table`
### Azure Update Script
- `azure-update`: This script is specifically for Azure Linux environments. It updates all packages and ensures necessary libraries are installed.
## Automation Scripts
This repository contains scripts for updating various Linux environments and tools:
- `linux-update`: Detects OS (Debian/Ubuntu/Azure Linux) and runs the corresponding update scripts.
- `azure-update`: Updates Azure Linux packages and installs necessary dependencies.
- `debian-update`: Updates Debian/Ubuntu packages and installs `git`.
- `gemini-update`: Updates the `@google/gemini-cli` via npm and checks versions of Node.js and Gemini.
- `nvm-update`: Installs NVM (Node Version Manager) and Node.js version 25.
Enter fullscreen mode Exit fullscreen mode

Perform Cross Cloud Operations

Now that all the building blocks are in place- the Azure VM has all the tools to have visibility into both clouds. Gemini CLI can be used directly with the gcloud utility running on Azure:

azureuser@azure-new:~/gemini-cli-azure$ gemini

  ▝▜▄ Gemini CLI v0.33.0
    ▝▜▄
   ▗▟▀ Logged in with Google /auth
  ▝▀ Gemini Code Assist Standard /upgrade


Tips for getting started:
1. /help for more information
2. Ask coding questions, edit code or run commands
3. Be specific for the best results
 > summarize my google cloud project with the gcloud tools
✦ I will begin by checking your current Google Cloud configuration and project details using the gcloud CLI.

✦ Based on the gcloud tools, here is a summary of your Google Cloud project:


  Project Overview
   * Project Name: glitnir
   * Project ID: comglitn
   * Project Number: 1056842563084
   * Account: xbill@glitnir.com
   * Status: Active (Created Aug 2014)
   * Labels: firebase: enabled, generative-language: enabled
Enter fullscreen mode Exit fullscreen mode

Using the ADK on Azure Cloud Shell

Now that the base environment has been enabled- a sample ADK project is cloned and initial setup is done:

git clone https://github.com/adk-hello-world
source set_env.sh
gcloud auth application-default login
Enter fullscreen mode Exit fullscreen mode

Once the environment is set- call the Agent1_cli.sh script:

azureuser@azure-new:~/adk-hello-world$ source Agent1_cli.sh 
--- Setting Google Cloud Environment Variables ---
Checking gcloud authentication status...
gcloud is authenticated.
Are you using a Gemini API Key? (y/N): 
Configuring for Vertex AI...
Exported PROJECT_ID=comglitn
Exported PROJECT_NUMBER=1056842563084
Exported SERVICE_ACCOUNT_NAME=1056842563084-compute@developer.gserviceaccount.com
Exported GOOGLE_CLOUD_PROJECT=comglitn
Exported GOOGLE_GENAI_USE_VERTEXAI=TRUE
Exported GOOGLE_CLOUD_LOCATION=us-central1
Exported REPO_NAME=
Exported REGION=us-central1
Exported AGENT_PATH=/home/azureuser/adk-hello-world/src/agents/adk_hello_world
--- Environment setup complete ---
/home/azureuser/adk-hello-world/src/agents/Agent1
adk run .
Log setup complete: /tmp/agents_log/agent.20260312_180433.log
To access latest log: tail -F /tmp/agents_log/agent.latest.log
/home/azureuser/.pyenv/versions/3.13.12/lib/python3.13/site-packages/google/adk/cli/utils/agent_loader.py:248: UserWarning: [EXPERIMENTAL] _load_from_yaml_config: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
  if root_agent := self._load_from_yaml_config(actual_agent_name, agents_dir):
/home/azureuser/.pyenv/versions/3.13.12/lib/python3.13/site-packages/google/adk/features/_feature_decorator.py:81: UserWarning: [EXPERIMENTAL] feature FeatureName.AGENT_CONFIG is enabled.
  check_feature_enabled()
/home/azureuser/.pyenv/versions/3.13.12/lib/python3.13/site-packages/google/adk/cli/cli.py:204: UserWarning: [EXPERIMENTAL] InMemoryCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
  credential_service = InMemoryCredentialService()
/home/azureuser/.pyenv/versions/3.13.12/lib/python3.13/site-packages/google/adk/auth/credential_service/in_memory_credential_service.py:33: UserWarning: [EXPERIMENTAL] BaseCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
  super(). __init__ ()
Running agent Agent1, type exit to exit.
[user]: what is the weather in Princeton, NJ?
[Agent1]: The weather in Princeton, NJ, is currently experiencing light rain with temperatures around 38-41°F (3-5°C). It feels like 30°F (-1°C) with humidity around 85%, and there's a 59% chance of rain.

For the rest of today, Thursday, March 12, 2026:
Expect light rain, potentially mixing with snow in the afternoon. Highs reached around 58-60°F (14-16°C) earlier, but temperatures are expected to fall sharply to near 35-40°F (2-4°C) by the afternoon, with winds from the northwest at 10 to 20 mph. The chance of precipitation remains high, between 70% and 90%.

Tonight, Thursday, March 12, 2026:
Forecasts vary, but generally predict partly cloudy to clear skies, with a low around 26°F (-3°C) and winds from the west-northwest at 5 to 10 mph. There is a slight chance of snow (5%).
[user]: 

Enter fullscreen mode Exit fullscreen mode

Running the ADK Web Interface

First ensure that port 8000 is open to external traffic on the VM:

azureuser@azure-new:~/adk-hello-world$ gemini

  ▝▜▄ Gemini CLI v0.33.0
    ▝▜▄
   ▗▟▀ Logged in with Google /auth
  ▝▀ Gemini Code Assist Standard /upgrade

Tips for getting started:
1. /help for more information
2. Ask coding questions, edit code or run commands
3. Be specific for the best results
 > check that port 8000 is open for internet traffic

✦ I will list the inbound rules for the azure-newNSG Network Security Group to see if port 8000 is open for internet traffic.

╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell az network nsg rule list -g VM --nsg-name azure-newNSG -o table [current working directory /home/azureuser/adk-hello-world] … │
│ │
│ Name ResourceGroup Priority SourcePortRanges SourceAddressPrefixes SourceASG Access Protocol │
│ Direction DestinationPortRanges DestinationAddressPrefixes DestinationASG │
│ ----------------- --------------- ---------- ------------------ ----------------------- ----------- -------- ---------- │
│ ----------- ----------------------- ---------------------------- ---------------- │
│ default-allow-ssh VM 1000 * * None Allow Tcp │
│ Inbound 22 * None │
│ allow-port-8000 VM 1010 * * None Allow Tcp │
│ Inbound 8000 * None │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ Port 8000 is open for internet traffic in the Azure Network Security Group (azure-newNSG).

   - Infrastructure: An inbound rule (allow-port-8000) allows all TCP traffic from any source to port 8000.
   - Local State: Currently, no process is listening on port 8000, and there are no OS-level firewall restrictions (ufw or iptables) blocking
     it.

Enter fullscreen mode Exit fullscreen mode

Start the Web ADK

Once the port has been opened- start the ADK Web Interface on host 0.0.0.0:

cd ~/adk-hello-world/src/agents
adk web --host 0.0.0.0

INFO: Started server process [3273]
INFO: Waiting for application startup.

+-----------------------------------------------------------------------------+
| ADK Web Server started |
| |
| For local testing, access at http://0.0.0.0:8000. |
+-----------------------------------------------------------------------------+

INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
Enter fullscreen mode Exit fullscreen mode

Verify the ADK Web interface

Check the external IP address of the Azure VM:

 > what is the external IP address of the VM?
✦ The external IP address of the VM is 20.124.121.35.
Enter fullscreen mode Exit fullscreen mode

Then navigate to the URL:

http://20.124.121.35:8000/dev-ui/
Enter fullscreen mode Exit fullscreen mode

The web interface will start:

Summary

Gemini CLI was downloaded and tested from an Azure Linux VM. This is a complete fully working version of Gemini CLI with all the standard features like extensions, agent skills, and a familiar interface. Then, Gemini CLI was used to perform Azure native operations using the built-in tooling. Finally the Google Cloud Tools were downloaded and installed. These tools were used to configure and run the ADK. This is a first step to enabling cross platform projects with both Google Cloud and Azure.

Top comments (0)