foundry-cross-resource

Route Azure Foundry requests through an APIM AI Gateway for cross-resource model invocation.

5|2|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/aiappsgbb/awesome-gbb --skill foundry-cross-resource
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundry-cross-resource
Source: https://github.com/aiappsgbb/awesome-gbb/tree/main/skills/foundry-cross-resource
Command: npx skills add https://github.com/aiappsgbb/awesome-gbb --skill foundry-cross-resource

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It enables a Foundry project to invoke AI models deployed in a different Azure OpenAI / AI Services account by routing calls through an Azure API Management (APIM) AI Gateway, without sharing backend API keys.

Core Features & Use Cases

  • Cross-resource invocation via APIM: Calls models on a backend account using the Foundry-native model string format connectionName/deploymentName.
  • Dual authentication options: Supports APIM gateway authentication using either ApiKey or ProjectManagedIdentity (PMI) paths.
  • APIM inbound policy wiring: Provides the exact policy approach for set-backend-service plus managed-identity token exchange and Authorization header injection, including required metadata quirks.

Quick Start

Configure your APIM API to forward Foundry requests to the backend model endpoint, then create a Foundry ApiManagement connection whose metadata uses JSON-stringified models and the correct deploymentInPath value, and finally call the model using model="yourConnection/yourDeployment" with the Responses API.

Frequently Asked Questions about foundry-cross-resource

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call Azure OpenAI models deployed in a different account from my Azure Foundry project?

Azure Foundry supports cross-resource model invocation by routing requests through an API Management AI Gateway. You can call models deployed in a separate Azure OpenAI or AI Services account using the connectionName/deploymentName model string format with the Responses API.

What is the correct APIM inbound policy for routing Foundry model calls through an AI Gateway?

The correct APIM inbound policy requires set-backend-service to target the backend model endpoint and a managed identity token exchange to inject the Authorization header. This policy wiring ensures the gateway authenticates correctly before forwarding the Foundry request.

Can I use a project managed identity instead of an API key for APIM gateway authentication in Foundry?

Yes, Foundry supports dual authentication paths for APIM gateway routing: ApiKey or ProjectManagedIdentity (PMI). Using PMI avoids sharing backend keys by exchanging a managed identity token for an Authorization header within the APIM inbound policy.

How do I configure Foundry connection metadata for an API Management gateway?

Configure the Foundry ApiManagement connection metadata by JSON-stringifying the models and modelDiscovery fields, and setting the correct deploymentInPath and inferenceAPIVersion values. This ensures the runtime resolves the gateway alias correctly during cross-resource inference.

Why does my Foundry cross-resource model invocation fail when using the Chat Completions API?

Cross-resource model invocation through APIM requires using the Responses API. The Responses API is necessary so the Foundry runtime correctly resolves the gateway alias defined in your JSON-stringified connection metadata model string.

Does Azure Foundry support cross-resource inference without exposing backend Azure OpenAI API keys?

Yes, Foundry enables cross-resource inference without exposing backend keys by routing through an APIM AI Gateway. The gateway uses either ApiKey or ProjectManagedIdentity authentication to securely access models deployed in a different Azure OpenAI account.