Skip to content

Commit 0022b58

Browse files
author
gitName
committed
review comment; merge
2 parents 5b1ee85 + ea572ab commit 0022b58

File tree

40 files changed

+431
-120
lines changed

40 files changed

+431
-120
lines changed

articles/api-management/TOC.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,20 +236,24 @@
236236
items:
237237
- name: AI gateway capabilities in API Management
238238
href: genai-gateway-capabilities.md
239-
- name: Import Azure AI Foundry API
240-
href: azure-ai-foundry-api.md
241-
- name: Import Azure OpenAI API
242-
href: azure-openai-api-from-specification.md
243-
- name: Import lanaguage model API
244-
href: openai-compatible-llm-api.md
245-
- name: Import Amazon Bedrock API
246-
href: amazon-bedrock-passthrough-llm-api.md
247-
- name: Authenticate and authorize to Azure OpenAI
248-
href: api-management-authenticate-authorize-azure-openai.md
239+
- name: Import LLM APIs
240+
items:
241+
- name: Import Azure AI Foundry API
242+
href: azure-ai-foundry-api.md
243+
- name: Import Azure OpenAI API
244+
href: azure-openai-api-from-specification.md
245+
- name: Import language model API
246+
href: openai-compatible-llm-api.md
247+
- name: Import Google Gemini API
248+
href: openai-compatible-google-gemini-api.md
249+
- name: Import Amazon Bedrock API
250+
href: amazon-bedrock-passthrough-llm-api.md
249251
- name: Expose REST API as MCP server
250252
href: export-rest-mcp-server.md
251253
- name: Semantic caching for Azure OpenAI API requests
252254
href: azure-openai-enable-semantic-caching.md
255+
- name: Authenticate and authorize to Azure OpenAI
256+
href: api-management-authenticate-authorize-azure-openai.md
253257
- name: Protect Azure OpenAI keys
254258
href: /semantic-kernel/deploy/use-ai-apis-with-api-management?toc=%2Fazure%2Fapi-management%2Ftoc.json&bc=/azure/api-management/breadcrumb/toc.json
255259
- name: Manage APIs with policies
@@ -691,4 +695,4 @@
691695
- name: Stack Overflow
692696
href: https://stackoverflow.com/questions/tagged/azure-api-management
693697
- name: aka.ms/apimlove
694-
href: https://aka.ms/apimlove
698+
href: https://aka.ms/apimlove

articles/api-management/amazon-bedrock-passthrough-llm-api.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,20 +270,21 @@ using Amazon.BedrockRuntime.Model;
270270
using Amazon.Runtime;
271271
using BedrockClient;
272272

273-
// Leave accessKey and secretKey values as empty strings.
273+
// Leave accessKey and secretKey values as empty strings. Authentication to AWS API is handled through policies in API Management.
274274
var accessKey = "";
275275
var secretKey = "";
276276
var credentials = new BasicAWSCredentials(accessKey, secretKey);
277277

278278
// Create custom configuration to route requests through API Management
279-
// apimUrl is the API Management endpoint, such as https://apim-helo-word.azure-api.net/bedrock
279+
// apimUrl is the API Management endpoint, such as https://apim-hello-word.azure-api.net/bedrock
280280
var apimUrl = "<api-management-endpoint">;
281281
// Provide name and value for the API Management subscription key header.
282282
var apimSubscriptionHeaderName = "api-key";
283283
var apimSubscriptionKey = "<your-apim-subscription-key>";
284284
var config = new AmazonBedrockRuntimeConfig()
285285
{
286286
HttpClientFactory = new BedrockHttpClientFactory(apimUrl, apimSubscriptionHeaderName, apimSubscriptionKey),
287+
// Set the AWS region where your Bedrock model is hosted.
287288
RegionEndpoint = RegionEndpoint.USEast1
288289
};
289290

132 KB
Loading
55.3 KB
Loading
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: Import OpenAI-Compatible Google Gemini API - Azure API Management
3+
description: How to import an OpenAI-compatible Google Gemini model as a REST API in Azure API Management and manage a chat completions endpoint
4+
ms.service: azure-api-management
5+
author: dlepow
6+
ms.author: danlep
7+
ms.topic: how-to
8+
ms.date: 07/06/2025
9+
ms.collection: ce-skilling-ai-copilot
10+
ms.custom: template-how-to
11+
---
12+
13+
# Import an OpenAI-compatible Google Gemini API
14+
15+
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
16+
17+
This article shows you how to import an OpenAI-compatible Google Gemini API to access models such as `gemini-2.0-flash`. For these models, Azure API Management can manage an OpenAI-compatible chat completions endpoint.
18+
19+
Learn more about managing AI APIs in API Management:
20+
21+
* [AI gateway capabilities in Azure API Management](genai-gateway-capabilities.md)
22+
* [Import a language model API](openai-compatible-llm-api.md)
23+
24+
## Prerequisites
25+
26+
- An existing API Management instance. [Create one if you haven't already](get-started-create-service-instance.md).
27+
- An API key for the Gemini API. If you don't have one, create it at [Google AI Studio](https://aistudio.google.com/apikey) and store it in a safe location.
28+
29+
30+
## Import an OpenAI-compatible Gemini API using the portal
31+
32+
1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance.
33+
1. In the left menu, under **APIs**, select **APIs** > **+ Add API**.
34+
1. Under **Define a new API**, select **Language Model API**.
35+
36+
:::image type="content" source="media/openai-compatible-llm-api/openai-api.png" alt-text="Screenshot of creating a passthrough language model API in the portal." :::
37+
1. On the **Configure API** tab:
38+
1. Enter a **Display name** and optional **Description** for the API.
39+
1. In **URL**, enter the following base URL from the [Gemini OpenAI compatibility documentation](https://ai.google.dev/gemini-api/docs/openai):
40+
`https://generativelanguage.googleapis.com/v1beta/openai`
41+
42+
1. In **Path**, append a path that your API Management instance uses to route requests to the Gemini API endpoints.
43+
1. In **Type**, select **Create OpenAI API**.
44+
1. In **Access key**, enter the following:
45+
1. **Header name**: *Authorization*.
46+
1. **Header value (key)**: `Bearer` followed by your API key for the Gemini API.
47+
48+
:::image type="content" source="media/openai-compatible-google-gemini-api/gemini-import.png" alt-text="Screenshot of importing a Gemini LLM API in the portal.":::
49+
50+
1. On the remaining tabs, optionally configure policies to manage token consumption, semantic caching, and AI content safety. For details, see [Import a language model API](openai-compatible-llm-api.md).
51+
1. Select **Review**.
52+
1. After settings are validated, select **Create**.
53+
54+
API Management creates the API and configures the following:
55+
56+
* A [backend](backends.md) resource and a [set-backend-service](set-backend-service-policy.md) policy that direct API requests to the Google Gemini endpoint.
57+
* Access to the LLM backend using the Gemini API key you provided. The key is protected as a secret [named value](api-management-howto-properties.md) in API Management.
58+
* (optionally) Policies to help you monitor and manage the API.
59+
60+
### Test Gemini model
61+
62+
After importing the API, you can test the chat completions endpoint for the API.
63+
64+
1. Select the API that you created in the previous step.
65+
1. Select the **Test** tab.
66+
1. Select the `POST Creates a model response for the given chat conversation` operation, which is a `POST` request to the `/chat/completions` endpoint.
67+
1. In the **Request body** section, enter the following JSON to specify the model and an example prompt. In this example, the `gemini-2.0-flash` model is used.
68+
69+
```json
70+
{
71+
"model": "gemini-2.0-flash",
72+
"messages": [
73+
{
74+
"role": "system",
75+
"content": "You are a helpful assistant"
76+
},
77+
{
78+
"role": "user",
79+
"content": "How are you?"
80+
}
81+
],
82+
"max_tokens": 50
83+
}
84+
```
85+
86+
When the test is successful, the backend responds with a successful HTTP response code and some data. Appended to the response is token usage data to help you monitor and manage your language model token consumption.
87+
88+
:::image type="content" source="media/openai-compatible-google-gemini-api/gemini-test.png" alt-text="Screenshot of testing a Gemini LLM API in the portal.":::
89+
90+
## Related content
91+
92+
* [AI gateway capabilities in Azure API Management](genai-gateway-capabilities.md)

articles/api-management/openai-compatible-llm-api.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
title: Import OpenAI-Compatible Language Model API - Azure API Management
3-
description: How to import an OpenAI-compatible language model or a non-Azure-provided AI model as a REST API in Azure API Management.
2+
title: Import Language Model API - Azure API Management
3+
description: How to import an OpenAI-compatible language model or a non-OpenAI-compatible AI model as a REST API in Azure API Management.
44
ms.service: azure-api-management
55
author: dlepow
66
ms.author: danlep
77
ms.topic: how-to
8-
ms.date: 05/15/2025
8+
ms.date: 07/06/2025
99
ms.update-cycle: 180-days
1010
ms.collection: ce-skilling-ai-copilot
11-
ms.custom: template-how-to, build-2024
11+
ms.custom: template-how-to
1212
---
1313

14-
# Import an OpenAI-compatible language model API
14+
# Import a language model API
1515

1616
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
1717

18-
You can import OpenAI-compatible language model endpoints to your API Management instance as APIs. For example, you might want to manage an LLM that you self-host, or that's hosted on an inference provider other than Azure AI services. Use AI gateway policies and other capabilities in API Management to simplify integration, improve observability, and enhance control over the model endpoints.
18+
You can import OpenAI-compatible language model endpoints to your API Management instance as APIs. You can also import language models that aren't compatible with OpenAI as passthrough APIs, which forward requests directly to the backend endpoints. For example, you might want to manage an LLM that you self-host, or that's hosted on an inference provider other than Azure AI services. Use AI gateway policies and other capabilities in API Management to simplify integration, improve observability, and enhance control over the model endpoints.
1919

2020
Learn more about managing AI APIs in API Management:
2121

@@ -25,9 +25,9 @@ Learn more about managing AI APIs in API Management:
2525

2626
API Management supports two types of language model APIs for this scenario. Choose the option suitable for your model deployment. The option determines how clients call the API and how the API Management instance routes requests to the AI service.
2727

28-
* **OpenAI-compatible** - Language model endpoints that are compatible with OpenAI's API. Examples include certain models exposed by inference providers such as [Hugging Face Text Generation Inference (TGI)](https://huggingface.co/docs/text-generation-inference/en/index).
28+
* **OpenAI-compatible** - Language model endpoints that are compatible with OpenAI's API. Examples include certain models exposed by inference providers such as [Hugging Face Text Generation Inference (TGI)](https://huggingface.co/docs/text-generation-inference/en/index) and [Google Gemini API](openai-compatible-google-gemini-api.md).
2929

30-
API Management configures an OpenAI-compatible chat completions endpoint.
30+
For an OpenAI-compatible LLM, API Management configures a chat completions endpoint.
3131

3232
* **Passthrough** - Other language model endpoints that aren't compatible with OpenAI's API. Examples include models deployed in [Amazon Bedrock](amazon-bedrock-passthrough-llm-api.md) or other providers.
3333

@@ -41,6 +41,11 @@ API Management supports two types of language model APIs for this scenario. Choo
4141

4242
## Import language model API using the portal
4343

44+
When you import the LLM API in the portal, API Management automatically configures:
45+
46+
* A [backend](backends.md) resource and a [set-backend-service](set-backend-service-policy.md) policy that direct API requests to the LLM endpoint.
47+
* (optionally) Access to the LLM backend using an access key you provide. The key is protected as a secret [named value](api-management-howto-properties.md) in API Management.
48+
* (optionally) Policies to help you monitor and manage the API.
4449

4550
To import a language model API to API Management:
4651

@@ -71,6 +76,8 @@ To import a language model API to API Management:
7176
1. Select **Review**.
7277
1. After settings are validated, select **Create**.
7378

79+
API Management creates the API, and configures operations for the LLM endpoints. By default, the API requires an API Management subscription.
80+
7481
## Test the LLM API
7582

7683
To ensure that your LLM API is working as expected, test it in the API Management test console.
@@ -85,5 +92,6 @@ To ensure that your LLM API is working as expected, test it in the API Managemen
8592

8693
When the test is successful, the backend responds with a successful HTTP response code and some data. Appended to the response is token usage data to help you monitor and manage your language model token consumption.
8794

95+
## Related content
8896

89-
[!INCLUDE [api-management-define-api-topics.md](../../includes/api-management-define-api-topics.md)]
97+
* [AI gateway capabilities in Azure API Management](genai-gateway-capabilities.md)

articles/app-service/app-service-hybrid-connections.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to create and use hybrid connections in Azure App Service
44
author: seligj95
55
ms.assetid: 66774bde-13f5-45d0-9a70-4e9536a4f619
66
ms.topic: article
7-
ms.date: 06/04/2025
7+
ms.date: 07/07/2025
88
ms.update-cycle: 1095-days
99
ms.author: jordanselig
1010
ms.custom:
@@ -170,6 +170,8 @@ To support the Hybrid Connections it's configured with, the Hybrid Connection Ma
170170

171171
- TCP access to Azure over port 443.
172172
- TCP access to the Hybrid Connection endpoint.
173+
- Windows clients must have ports 4999-5001 available.
174+
- Linux clients must have port 5001 available.
173175
- The ability to do DNS look-ups on the endpoint host and the Service Bus namespace. In other words, the hostname in the Azure relay connection should be resolvable from the machine that hosts the Hybrid Connection Manager.
174176

175177
### Getting started with the Hybrid Connection Manager GUI

0 commit comments

Comments
 (0)