You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-management/api-management-authenticate-authorize-azure-openai.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,7 @@ Following are steps to configure your API Management instance to use a managed i
103
103
```
104
104
105
105
> [!TIP]
106
-
> An alternative to using the `authentication-managed-identity` and `set-header` policies shown in this example is to configure a [backend](backends.md) resource that directs API requests to the Azure OpenAI Service endpoint. In the backend configuration, enable managed identity authentication to the Azure OpenAI Service. Azure API Management automates these steps when importing an API directly from Azure OpenAI Service. For more information, see [Import API from Azure OpenAI Service](azure-openai-api-from-specification.md#option-1-import-api-from-azure-openai-service).
106
+
> An alternative to using the `authentication-managed-identity` and `set-header` policies shown in this example is to configure a [backend](backends.md) resource that directs API requests to the Azure OpenAI Service endpoint. In the backend configuration, enable managed identity authentication to the Azure OpenAI Service. Azure API Management automates these steps when importing an API directly from Azure OpenAI Service. For more information, see [Import API from Azure OpenAI Service](azure-openai-api-from-specification.md#option-1-import-api-from-azure-openai).
107
107
108
108
## OAuth 2.0 authorization using identity provider
Copy file name to clipboardExpand all lines: articles/api-management/azure-ai-foundry-api.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Learn more about managing AI APIs in API Management:
26
26
27
27
API Management supports two client compatibility options for AI APIs. 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.
28
28
29
-
***Azure AI** - Manage model endpoints in Azure AI Foundry that are exposed through the [Azure AI Model Inference API](/azure/ai-studio/reference/reference-model-inference-api).
29
+
***Azure AI** - Manage model endpoints in Azure AI Foundry that are exposed through the [Azure AI Model Inference API](/azure/ai-studio/reference/reference-model-inference-api).
30
30
31
31
Clients call the deployment at a `/models` endpoint such as `/my-model/models/chat/completions`. Deployment name is passed in the request body. Use this option if you want flexibility to switch between models exposed through the Azure AI Model Inference API and those deployed in Azure OpenAI in Foundry Models.
32
32
@@ -37,7 +37,8 @@ API Management supports two client compatibility options for AI APIs. Choose the
37
37
## Prerequisites
38
38
39
39
- An existing API Management instance. [Create one if you haven't already](get-started-create-service-instance.md).
40
-
- An Azure AI service in your subscription with one or more models deployed. Examples include Azure OpenAI or other models deployed in Azure AI Foundry.
40
+
41
+
- An Azure AI service in your subscription with one or more models deployed. Examples include models deployed in Azure AI Foundry or Azure OpenAI.
You can import AI model endpoints deployed in [Azure OpenAI Service](/azure/ai-services/openai/overview) to your API Management instance as a REST API. 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 AI model endpoints deployed in [Azure OpenAI in Foundry Models](/azure/ai-services/openai/overview) to your API Management instance as a REST API. Use AI gateway policies and other capabilities in API Management to simplify integration, improve observability, and enhance control over the model endpoints.
19
19
20
20
21
21
This article shows two options to import an Azure OpenAI API into an Azure API Management instance as a REST API:
22
22
23
-
-[Import an Azure OpenAI API directly from Azure OpenAI Service](#option-1-import-api-from-azure-openai-service) (recommended)
23
+
-[Import an Azure OpenAI API directly from Azure OpenAI in Foundry Models](#option-1-import-api-from-azure-openai) (recommended)
24
24
-[Download and add the OpenAPI specification](#option-2-add-an-openapi-specification-to-api-management) for Azure OpenAI and add it to API Management as an OpenAPI API.
25
25
26
26
Learn more about managing AI APIs in API Management:
@@ -30,36 +30,36 @@ Learn more about managing AI APIs in API Management:
30
30
## Prerequisites
31
31
32
32
- An existing API Management instance. [Create one if you haven't already](get-started-create-service-instance.md).
33
-
- An Azure OpenAI resource with a model deployed. For more information about model deployment in Azure OpenAI service, see the [resource deployment guide](/azure/ai-services/openai/how-to/create-resource).
33
+
- An Azure OpenAI resource with a model deployed. For more information about model deployment in Azure OpenAI, see the [resource deployment guide](/azure/ai-services/openai/how-to/create-resource).
34
34
35
35
Make a note of the ID (name) of the deployment. You'll need it when you test the imported API in API Management.
36
36
37
37
> [!NOTE]
38
-
> API Management policies such as [azure-openai-token-limit](azure-openai-token-limit-policy.md) and [azure-openai-emit-token-metric](azure-openai-emit-token-metric-policy.md) are supported for certain API endpoints exposed through specific Azure OpenAI Service models. For more information, see [Supported Azure OpenAI Service models](azure-openai-token-limit-policy.md#supported-azure-openai-service-models).
38
+
> API Management policies such as [azure-openai-token-limit](azure-openai-token-limit-policy.md) and [azure-openai-emit-token-metric](azure-openai-emit-token-metric-policy.md) are supported for certain API endpoints exposed through specific Azure OpenAI models. For more information, see [Supported Azure OpenAI in Foundry Models](azure-openai-token-limit-policy.md).
39
39
40
40
- Permissions to grant access to the Azure OpenAI resource from the API Management instance.
41
41
42
-
## Option 1. Import API from Azure OpenAI Service
42
+
## Option 1. Import API from Azure OpenAI
43
43
44
-
You can import an Azure OpenAI API directly from Azure OpenAI Service to API Management.
44
+
You can import an Azure OpenAI API directly from Azure OpenAI to API Management.
When you import the API, API Management automatically configures:
49
49
50
50
* Operations for each of the Azure OpenAI [REST API endpoints](/azure/ai-services/openai/reference)
51
51
* A system-assigned identity with the necessary permissions to access the Azure OpenAI resource.
52
-
* A [backend](backends.md) resource and a [set-backend-service](set-backend-service-policy.md) policy that direct API requests to the Azure OpenAI Service endpoint.
52
+
* A [backend](backends.md) resource and a [set-backend-service](set-backend-service-policy.md) policy that direct API requests to the Azure OpenAI endpoint.
53
53
* Authentication to the Azure OpenAI backend using the instance's system-assigned managed identity.
54
54
* (optionally) Policies to help you monitor and manage the Azure OpenAI API.
55
55
56
56
To import an Azure OpenAI API to API Management:
57
57
58
58
1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance.
59
59
1. In the left menu, under **APIs**, select **APIs** > **+ Add API**.
60
-
1. Under **Create from Azure resource**, select **Azure OpenAI Service**.
60
+
1. Under **Create from Azure resource**, select **Azure OpenAI**.
61
61
62
-
:::image type="content" source="media/azure-openai-api-from-specification/azure-openai-api.png" alt-text="Screenshot of creating an API from Azure OpenAI Service in the portal." :::
62
+
:::image type="content" source="media/azure-openai-api-from-specification/azure-openai-api.png" alt-text="Screenshot of creating an API from Azure OpenAI in the portal." :::
63
63
64
64
1. On the **Basics** tab:
65
65
1. Select the Azure OpenAI resource that you want to import.
@@ -89,7 +89,7 @@ Alternatively, manually download the OpenAPI specification for the Azure OpenAI
89
89
Download the OpenAPI specification for the Azure OpenAI REST API, such as the [2024-10-21 GA version](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-10-21/inference.json).
90
90
91
91
1. In a text editor, open the specification file that you downloaded.
92
-
1. In the `servers` element in the specification, substitute the name of your Azure OpenAI Service endpoint in the placeholder values of `url` and `default` endpoint in the specification. For example, if your Azure OpenAI Service endpoint is `contoso.openai.azure.com`, update the `servers` element with the following values:
92
+
1. In the `servers` element in the specification, substitute the name of your Azure OpenAI endpoint in the placeholder values of `url` and `default` endpoint in the specification. For example, if your Azure OpenAI endpoint is `contoso.openai.azure.com`, update the `servers` element with the following values:
@@ -135,9 +135,9 @@ To ensure that your Azure OpenAI API is working as expected, test it in the API
135
135
1. Select an operation that's compatible with the model you deployed in the Azure OpenAI resource.
136
136
The page displays fields for parameters and headers.
137
137
1. In **Template parameters**, enter the following values:
138
-
* `deployment-id` - the ID of a deployment in the Azure OpenAI service
138
+
* `deployment-id` - the ID of a deployment in the Azure OpenAI
139
139
* `api-version` - a valid Azure OpenAI API version, such as the API version you selected when you imported the API.
140
-
:::image type="content" source="media/azure-openai-api-from-specification/test-azure-openai-api.png" alt-text="Screenshot of testing an Azure OpenAI Service API in the portal." lightbox="media/azure-openai-api-from-specification/test-azure-openai-api.png" :::
140
+
:::image type="content" source="media/azure-openai-api-from-specification/test-azure-openai-api.png" alt-text="Screenshot of testing an Azure OpenAI API in the portal." lightbox="media/azure-openai-api-from-specification/test-azure-openai-api.png" :::
141
141
1. Enter other parameters and headers as needed. Depending on the operation, you might need to configure or update a **Request body**.
142
142
> [!NOTE]
143
143
> In the test console, API Management automatically populates an **Ocp-Apim-Subscription-Key** header, and configures the subscription key of the built-in [all-access subscription](api-management-subscriptions.md#all-access-subscription). This key enables access to every API in the API Management instance. Optionally display the **Ocp-Apim-Subscription-Key** header by selecting the "eye" icon next to the **HTTP Request**.
Copy file name to clipboardExpand all lines: articles/api-management/azure-openai-enable-semantic-caching.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ Enable semantic caching of responses to Azure OpenAI API requests to reduce band
25
25
26
26
* One or more Azure OpenAI in Foundry Models APIs must be added to your API Management instance. For more information, see [Add an Azure OpenAI API to Azure API Management](azure-openai-api-from-specification.md).
27
27
* The Azure OpenAI instance must have deployments for the following:
28
+
28
29
* Chat Completion API - Deployment used for API consumer calls
29
30
* Embeddings API - Deployment used for semantic caching
30
31
* The API Management instance must be configured to use managed identity authentication to the Azure OpenAI APIs. For more information, see [Authenticate and authorize access to Azure OpenAI APIs using Azure API Management ](api-management-authenticate-authorize-azure-openai.md#authenticate-with-managed-identity).
@@ -58,10 +59,8 @@ Configure a [backend](backends.md) resource for the embeddings API deployment wi
58
59
59
60
***Name** - A name of your choice, such as `embeddings-backend`. You use this name to reference the backend in policies.
60
61
***Type** - Select **Custom URL**.
61
-
***Runtime URL** - The URL of the embeddings API deployment in the Azure OpenAI instance, similar to:
***Runtime URL** - The URL of the embeddings API deployment in Azure OpenAI, similar to: `https://my-aoai.openai.azure.com/openai/deployments/embeddings-deployment/embeddings`
63
+
65
64
***Authorization credentials** - Go to **Managed Identity** tab.
66
65
***Client identity** - Select *System assigned identity* or type in a User assigned managed identity client ID.
67
66
***Resource ID** - Enter `https://cognitiveservices.azure.com/` for Azure OpenAI.
The `azure-openai-token-limit` policy prevents Azure OpenAI Service API usage spikes on a per key basis by limiting consumption of language model tokens to a specified rate (number per minute), a quota over a specified period, or both. When a specified token rate limit is exceeded, the caller receives a `429 Too Many Requests` response status code. When a specified quota is exceeded, the caller receives a `403 Forbidden` response status code.
21
+
The `azure-openai-token-limit` policy prevents Azure OpenAI in Foundry Models API usage spikes on a per key basis by limiting consumption of language model tokens to a specified rate (number per minute), a quota over a specified period, or both. When a specified token rate limit is exceeded, the caller receives a `429 Too Many Requests` response status code. When a specified quota is exceeded, the caller receives a `403 Forbidden` response status code.
22
22
23
23
By relying on token usage metrics returned from the OpenAI endpoint, the policy can accurately monitor and enforce limits in real time. The policy also enables precalculation of prompt tokens by API Management, minimizing unnecessary requests to the OpenAI backend if the limit is already exceeded.
24
24
@@ -70,8 +70,8 @@ By relying on token usage metrics returned from the OpenAI endpoint, the policy
70
70
### Usage notes
71
71
72
72
* This policy can be used multiple times per policy definition.
73
-
* This policy can optionally be configured when adding an API from the Azure OpenAI Service using the portal.
74
-
* Where available when `estimate-prompt-tokens` is set to `false`, values in the usage section of the response from the Azure OpenAI Service API are used to determine token usage.
73
+
* This policy can optionally be configured when adding an API from the Azure OpenAI using the portal.
74
+
* Where available when `estimate-prompt-tokens` is set to `false`, values in the usage section of the response from the Azure OpenAI API are used to determine token usage.
75
75
* Certain Azure OpenAI endpoints support streaming of responses. When `stream` is set to `true` in the API request to enable streaming, prompt tokens are always estimated, regardless of the value of the `estimate-prompt-tokens` attribute. Completion tokens are also estimated when responses are streamed.
76
76
* For models that accept image input, image tokens are generally counted by the backend language model and included in limit and quota calculations. However, when streaming is used or `estimate-prompt-tokens` is set to `true`, the policy currently over-counts each image as a maximum count of 1200 tokens.
Copy file name to clipboardExpand all lines: articles/app-service/app-service-hybrid-connections.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ When a Hybrid Connection is added to your app, you can see details on it simply
89
89
90
90
To create a Hybrid Connection using an ARM/Bicep template, add the following resource to your existing template. You must include the `userMetadata` to have a valid Hybrid Connection. If you don't include the `userMetadata`, the Hybrid Connection doesn't work. If you create the Hybrid Connection in the Azure portal, this property is automatically filled in for you.
91
91
92
-
The `userMetadata` property should be a string representation of a JSON array in the format `[{"key": "endpoint", "value : "host:port"}]`. The following Bicep template has a sample for this property. For more information, see [Microsoft.Relay namespaces/hybridConnections](/azure/templates/microsoft.relay/namespaces/hybridconnections).
92
+
The `userMetadata` property should be a string representation of a JSON array in the format `[{/"key/": /"endpoint/", /"value/" : /"<HOST>:<PORT>/"}]`. For more information, see [Microsoft.Relay namespaces/hybridConnections](/azure/templates/microsoft.relay/namespaces/hybridconnections).
0 commit comments