-
Notifications
You must be signed in to change notification settings - Fork 140
/
Copy pathpolicy.xml
36 lines (33 loc) · 1.33 KB
/
policy.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<policies>
<inbound>
<base />
<!-- Use a <choose> block to evaluate deployment-id -->
<choose>
<when condition="@(context.Request.MatchedParameters["deployment-id"] == "gpt-35-turbo-1106")">
<set-backend-service backend-id="{backend-id-1}" />
</when>
<when condition="@(context.Request.MatchedParameters["deployment-id"] == "gpt-35-turbo-0125")">
<set-backend-service backend-id="{backend-id-2}" />
</when>
<when condition="@(context.Request.MatchedParameters["deployment-id"] == "gpt-4o-2024-05-13")">
<set-backend-service backend-id="{backend-id-3}" />
</when>
<otherwise>
<set-backend-service backend-id="{backend-id-1}" />
</otherwise>
</choose>
<authentication-managed-identity resource="https://cognitiveservices.azure.com" output-token-variable-name="managed-id-access-token" ignore-error="false" />
<set-header name="Authorization" exists-action="override">
<value>@("Bearer " + (string)context.Variables["managed-id-access-token"])</value>
</set-header>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>