Modern applications often depend on services running across multiple cloud platforms. An organization might host its application in Azure while using Google Cloud for data processing, storage, analytics, or other infrastructure services.
Managing these environments becomes challenging when an application experiences an incident that requires investigation across cloud boundaries. Engineers need access to logs, metrics, service configurations, and operational information from multiple platforms.
Azure SRE Agent helps engineering teams investigate operational problems using AI-assisted workflows. However, connecting it to Google Cloud introduces an important security consideration: how can an agent access Google Cloud resources without storing long-lived service account keys?
A better approach is to use identity federation. Instead of creating and distributing permanent credentials, an organization can establish trust between an Azure-managed identity and Google Cloud's identity platform.
In this article, we will explore how workload identity federation works, how to connect Azure SRE Agent with Google Cloud, and which security practices developers should follow for production environments.
Why Avoid Google Cloud Service Account Keys?
Google Cloud service accounts are commonly used to provide applications and automated workloads with access to cloud resources.
Traditionally, an application could authenticate by downloading a service account JSON key and storing it in its configuration.
For example, an application might use a configuration file containing credentials:
{
"type": "service_account",
"project_id": "production-project",
"private_key_id": "example-key-id",
"private_key": "PRIVATE_KEY_VALUE",
"client_email": "[email protected]"
}
The application uses this information to authenticate with Google Cloud APIs.
Although this approach works, managing permanent credentials introduces several security challenges.
- Keys can accidentally appear in source control.
- Developers may store credentials in application configuration files.
- Keys can be copied between environments.
- Compromised keys may remain usable until revoked.
- Key rotation introduces additional operational work.
- Multiple applications may end up sharing the same credentials.
For an AI-powered operations agent, these risks become more important because the agent may access infrastructure information across several projects.
Instead of managing permanent keys, organizations can use Workload Identity Federation.
Understanding Workload Identity Federation
Workload Identity Federation allows applications running outside Google Cloud to authenticate using an external identity provider.
It supports identity providers such as Microsoft Entra ID, AWS, and other systems that support the required federation protocols.
In this integration, Azure SRE Agent uses an Azure managed identity to establish trust with Google Cloud.
The authentication process works as follows:
- Azure SRE Agent obtains an identity token using its selected managed identity.
- The token is presented to Google Cloud Security Token Service.
- Google Cloud validates the token against the configured OpenID Connect provider.
- Google Cloud checks the identity attributes and trust conditions.
- Google Cloud issues a short-lived federated access token.
- The agent uses that token to access authorized Google Cloud resources.
The architecture looks like this:
Azure SRE Agent
|
v
Azure Managed Identity
|
v
Microsoft Entra ID
|
v
OIDC Token
|
v
Google Cloud Security
Token Service
|
v
Workload Identity Federation
|
v
Short-Lived Token
|
v
Google Cloud IAM
|
v
Google Cloud Resources
The important difference is that Google Cloud trusts a verified external identity instead of requiring a permanent private key.
This integration uses direct access for the federated identity. It does not require creating a Google Cloud service account key or uploading one to Azure SRE Agent.
Understanding the Components Required for Integration
Before configuring the connection, developers should understand the main components.
| Component | Responsibility |
|---|
| Azure managed identity | Provides the identity used by Azure SRE Agent |
| Microsoft Entra ID | Issues identity tokens |
| OIDC provider | Establishes trust between Google Cloud and the external identity provider |
| Workload identity pool | Organizes external workload identities |
| Google Cloud IAM | Defines resource access permissions |
| Google Cloud Security Token Service | Exchanges the external identity token for a federated token |
Each component has a different responsibility.
The OIDC provider determines which external identity can authenticate, while Google Cloud IAM determines which resources that identity can access.
Both configurations must be correct.
Prerequisites for Connecting Azure SRE Agent With Google Cloud
Before starting the integration, ensure that the following requirements are available:
- An existing Azure SRE Agent.
- Permission to create or update connectors.
- An Azure managed identity available in the agent's identity selector.
- A Google Cloud project for hosting the workload identity pool.
- Permissions to configure Google Cloud IAM and workload identity federation.
- Access to the Google Cloud projects that need investigation.
The following Google Cloud APIs must also be enabled in the project hosting the workload identity pool:
- IAM API.
- Security Token Service API.
- Cloud Resource Manager API.
One important distinction is that Google Cloud project ID and project number are different.
The workload identity provider resource name and federated principal use the numeric project number of the project hosting the pool. However, commands targeting application resources generally use the project ID.
Connecting Azure SRE Agent With Google Cloud
The Google Cloud connector is available as a preview capability. Enable Early access to features in the agent's settings before configuring it.
Step 1: Open Cloud Provider Connections
Open Azure SRE Agent and navigate to the connector configuration area.
Follow this navigation:
Build + configure
|
v
Extensions
|
v
Cloud providers
|
v
Create connection
|
v
Google Cloud (GCP)
Select Google Cloud to start the connection wizard.
Step 2: Select the Azure Managed Identity
Select the managed identity that Azure SRE Agent will use to authenticate with Google Cloud.
The configuration wizard provides the identity details required for federation.
Keep the following values available:
| Value | Purpose |
|---|
| Tenant ID | Identifies the Microsoft Entra tenant |
| Managed identity principal ID | Identifies the managed identity |
| Managed identity client ID | Identifies the managed identity in its application context |
| Allowed audience | Identifies the intended token audience |
For this connector, the allowed audience is:
59f0a04a-b322-4310-adc9-39ac41e9631e
An important detail is that the managed identity principal ID and client ID are not interchangeable. Google Cloud's provider configuration uses the principal or object ID for identity matching.
Step 3: Create a Google Cloud Workload Identity Pool
Open the Google Cloud Console and select the project that will host the workload identity pool.
Navigate to:
IAM & Admin
|
v
Workload Identity Federation
|
v
Create Pool
Create a dedicated pool for Azure SRE Agent.
For example:
Pool ID: sre-agent-pool
Record the pool ID and the numeric project number of the hosting project.
A dedicated pool helps keep the external identity configuration organized and separate from unrelated workloads.
Step 4: Configure the OIDC Provider
Inside the workload identity pool, create an OpenID Connect provider.
Use the values supplied by the Azure SRE Agent configuration wizard.
| Setting | Configuration |
|---|
| Provider type | OpenID Connect |
| Issuer URL | https://login.microsoftonline.com/TENANT_ID/v2.0 |
| Allowed audience | 59f0a04a-b322-4310-adc9-39ac41e9631e |
| Google attribute | google.subject |
| OIDC expression | assertion.tid+'::'+assertion.oid |
| Attribute condition | assertion.oid=='MI_PRINCIPAL_ID' |
Replace TENANT_ID and MI_PRINCIPAL_ID with the actual values from the selected managed identity.
The attribute mapping combines the tenant ID and principal ID to create the federated subject.
The attribute condition ensures that only the selected managed identity can authenticate through the provider.
Do not remove this condition or replace the principal ID with the client ID.
Step 5: Grant Google Cloud IAM Permissions
After creating the provider, grant access to the federated identity.
The principal follows this format:
principal://iam.googleapis.com/projects/POOL_PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/subject/TENANT_ID::MI_PRINCIPAL_ID
Replace the placeholders with the actual configuration values.
In Google Cloud Console, navigate to IAM and select Grant Access.
Add the federated principal and assign the permissions required for the investigation.
For example, an SRE agent investigating Compute Engine and Cloud Logging may need permissions to inspect instances, retrieve logs, and view project information.
Include resourcemanager.projects.get so the project can appear in the connector's project-list check.
For production environments, use predefined read-only roles or carefully designed custom roles instead of granting broad Owner or Editor access.
Step 6: Configure the Provider Connection
Return to the Azure SRE Agent connection wizard.
Enter the connection details:
Connection Name: gcp-production
Workload Identity Provider ID:
projects/POOL_PROJECT_NUMBER/locations/global/
workloadIdentityPools/sre-agent-pool/
providers/sre-agent-provider
The provider ID must contain the complete resource name, including the hosting project number, pool ID, and provider ID.
A short provider name alone is not sufficient.
Select Test connection to verify the configuration.
The test executes:
gcloud projects list
If authentication and project-list access are configured correctly, the test should complete successfully.
One important detail is that a successful connection test does not verify access to every Google Cloud service or resource.
Step 7: Select Read or Write Access
After testing the connection, select the appropriate access level.
| Access level | Description |
|---|
| Read | Allows supported operations to inspect resources without making changes |
| Write | Allows supported read and write operations, subject to IAM permissions and agent policies |
Start with Read access for investigation workloads.
Write access should only be enabled when the agent has a clearly defined operational responsibility.
Also remember that selecting Write does not automatically grant additional Google Cloud IAM permissions or bypass the agent's approval settings.
After selecting the required access level, choose Connect provider.
The connection should appear under Google Cloud in the Cloud providers section with a Connected status.
Investigating Google Cloud Resources With Azure SRE Agent
After completing the connection, engineers can use Azure SRE Agent chat to investigate Google Cloud resources.
For example, consider a Google Cloud application experiencing unexpected errors.
An engineer can ask:
Using my gcp-production connection,
investigate errors in the Cloud Run service
named customer-api.
Project: production-project
Region: asia-south1
Time range: Last one hour
Review available logs and identify
possible causes of the failures.
The agent can use the connected Google Cloud CLI capabilities to retrieve relevant information, subject to its configured permissions.
Other investigation scenarios include:
- Inspecting Compute Engine instances.
- Reviewing Cloud Logging entries.
- Investigating Cloud Run errors.
- Checking infrastructure configuration.
- Examining resource availability.
- Correlating application failures with cloud infrastructure.
Providing the connection name, project ID, resource name, region, and time range makes investigations more focused.
Best Practices for Production Environments
Avoid Long-Lived Credentials
Do not create service account JSON keys simply to simplify the integration.
Use Workload Identity Federation and short-lived credentials to reduce the risk associated with permanent secrets.
Restrict Identity Federation
Configure the OIDC provider with the correct tenant, audience, and managed identity principal ID.
Do not allow every identity from the tenant or pool to authenticate unnecessarily.
Follow Least Privilege
Start with read-only access and grant permissions only for the required resources.
Avoid broad administrative roles.
Separate Cloud Environments
Use meaningful connection names and separate access policies for development, staging, and production environments.
Enable Audit Logging
Configure Google Cloud Audit Logs to monitor supported activity performed through the federated identity.
Review unexpected access and changes to IAM permissions.
Control Write Operations
Use the agent's run modes and tool approval policies to control sensitive actions.
Infrastructure investigation and infrastructure modification should have different authorization requirements.
Advantages and Disadvantages
Advantages:
- Eliminates the need to store Google Cloud service account keys.
- Uses Azure managed identity for authentication.
- Provides short-lived federated credentials.
- Supports access across multiple Google Cloud projects.
- Reduces credential rotation and distribution responsibilities.
- Integrates Google Cloud investigation capabilities into Azure SRE Agent.
- Supports controlled read and write operations.
Disadvantages:
- Requires initial identity federation configuration.
- Incorrect OIDC settings can prevent authentication.
- IAM permissions must be managed separately for target projects.
- Not every Google Cloud service or CLI operation is supported.
- The connector currently uses a shared configured managed identity rather than individual user identities.
- Preview functionality may have limitations.
Common Mistakes and Troubleshooting
| Problem | Possible reason | Recommended solution |
|---|
| Connection test fails | Incorrect OIDC issuer or audience | Verify tenant ID and allowed audience |
| Authentication is rejected | Incorrect identity condition | Check the managed identity principal ID |
| Projects are missing | Missing project-level IAM access | Grant the federated principal access to target projects |
| Provider cannot be found | Incorrect provider resource name | Use the complete provider ID |
| Resource access is denied | Missing Google Cloud permissions | Review IAM role assignments |
| Write operation is blocked | Connector or agent permissions are insufficient | Review Write access, IAM roles, and approval policies |
| Required service is unavailable | Unsupported service or missing API | Check service federation support and enable required APIs |
One limitation worth understanding is that the connector does not support every Google Cloud CLI operation. For example, shell and local-file operations, GKE get-credentials, and KMS encryption and decryption operations are unavailable through this connector.
Therefore, successful authentication should not be confused with complete Google Cloud administrative access.
Summary
Connecting Azure SRE Agent with Google Cloud without storing service account keys provides a more secure approach to cross-cloud infrastructure investigation.
Google Cloud Workload Identity Federation allows the agent to authenticate using an Azure managed identity and obtain short-lived access tokens through OpenID Connect.
The integration requires a workload identity pool, an OIDC provider, appropriate IAM permissions, and a configured Google Cloud connector in Azure SRE Agent.
However, authentication is only one part of the security model. Developers must also restrict federated identities, grant resource-specific permissions, configure approval policies, and monitor access through audit logging.
By combining managed identity, workload identity federation, and least-privilege IAM permissions, organizations can investigate Google Cloud infrastructure from Azure SRE Agent without introducing long-lived service account keys into their operational environment.
Join the conversation! Your thoughts help the community grow.