From 4b4fd247023bc315c4d0aa2e46b700dde2b4df94 Mon Sep 17 00:00:00 2001 From: Kjell Tore Guttormsen Date: Wed, 24 Jun 2026 12:15:37 +0200 Subject: [PATCH] =?UTF-8?q?docs(ms-ai-architect):=20KB-refresh=20LOW=2021/?= =?UTF-8?q?52=20=E2=80=94=20genai-gateway-policies:=20token-quota-period?= =?UTF-8?q?=20sek=E2=86=92Daily,=20KQL=20ModelDeployment=E2=86=92Deploymen?= =?UTF-8?q?tName,=20llm-token-limit=20Consumption=20Nei,=20semantic-cache?= =?UTF-8?q?=20tier-matrise=20korrigert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api-management/genai-gateway-policies.md | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/skills/ms-ai-engineering/references/api-management/genai-gateway-policies.md b/skills/ms-ai-engineering/references/api-management/genai-gateway-policies.md index 4321b25..f9c1c95 100644 --- a/skills/ms-ai-engineering/references/api-management/genai-gateway-policies.md +++ b/skills/ms-ai-engineering/references/api-management/genai-gateway-policies.md @@ -1,6 +1,6 @@ # GenAI-Specific APIM Policies & Rules -**Last updated:** 2026-02 +**Last updated:** 2026-06-24 **Status:** GA **Category:** API Management & AI Gateway @@ -322,11 +322,10 @@ Sett token-kvoter per dag, uke eller måned: + remaining-quota-tokens-variable-name="dailyRemaining" /> @@ -389,7 +388,8 @@ For å oppnå global rate limiting, bruk `quota-by-key` i stedet for `llm-token- | `TimeGenerated` | Tidspunkt for request | 2026-02-11T10:30:00Z | | `CorrelationId` | Unik request-ID | abc-123-def | | `OperationName` | API-operasjon | ChatCompletions | -| `ModelDeployment` | Deployment-navn | gpt-4o | +| `DeploymentName` | Deployment-navn | gpt-4o | +| `ModelName` | Modellnavn | gpt-4o | | `PromptTokens` | Antall prompt-tokens | 150 | | `CompletionTokens` | Antall completion-tokens | 250 | | `TotalTokens` | Totalt token-forbruk | 400 | @@ -409,7 +409,7 @@ ApiManagementGatewayLlmLog | project TimeGenerated, CorrelationId, - Model = ModelDeployment, + Model = DeploymentName, PromptTokens, CompletionTokens, Prompt = tostring(RequestArray.content), @@ -426,9 +426,15 @@ ApiManagementGatewayLlmLog ```kusto // Finn uvanlig høy token-bruk per bruker +// Brukeridentitet finnes ikke i ApiManagementGatewayLlmLog — join mot +// ApiManagementGatewayLogs på CorrelationId for UserId/ApimSubscriptionId. ApiManagementGatewayLlmLog | where TimeGenerated > ago(7d) -| extend UserId = tostring(CustomDimensions["UserId"]) +| join kind=leftouter ( + ApiManagementGatewayLogs + | where TimeGenerated > ago(7d) + | distinct CorrelationId, UserId + ) on CorrelationId | summarize AvgTokens = avg(toint(TotalTokens)), MaxTokens = max(toint(TotalTokens)), @@ -598,9 +604,9 @@ Outbound (fra topp til bunn): | Policy | Classic | V2 | Consumption | Self-hosted | Workspace | |--------|---------|-----|-------------|-------------|-----------| | `llm-content-safety` | Ja | Ja | Ja | Ja | Ja | -| `llm-token-limit` | Ja | Ja | Ja | Ja | Ja | -| `llm-semantic-cache-lookup` | Ja | Ja | Nei | Nei | Ja | -| `llm-semantic-cache-store` | Ja | Ja | Nei | Nei | Ja | +| `llm-token-limit` | Ja | Ja | Nei | Ja | Ja | +| `llm-semantic-cache-lookup` | Ja | Ja | Ja | Ja | Nei | +| `llm-semantic-cache-store` | Ja | Ja | Ja | Ja | Nei | | `llm-emit-token-metric` | Ja | Ja | Ja | Ja | Ja | ---