File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # To set up AZD environment variabless
4
+ # for use with ACA load balancer https://github.com/Azure-Samples/openai-aca-lb
5
+ #
6
+ # Prereq: az login --use-device-code
7
+ # Example usage: bash load-balance-aca-setup.sh <ACA-LB-RESOURCE-GROUP-NAME> <ACA-LB-CONTAINER-APP-URI>
8
+
9
+ resourceGroupName=" your-resource-group-name"
10
+ containerAppName=" your-container-app-name"
11
+
12
+ # Check if resourceGroupName is empty
13
+ if [ -z " $resourceGroupName " ]; then
14
+ echo " Error: resourceGroupName is empty"
15
+ exit 1
16
+ fi
17
+
18
+ # Check if containerAppName is empty
19
+ if [ -z " $containerAppName " ]; then
20
+ echo " Error: containerAppName is empty"
21
+ exit 1
22
+ fi
23
+
24
+ fqdn=$( az container show --name $containerAppName --resource-group $resourceGroupName --query ipAddress.fqdn --output tsv)
25
+
26
+ # Check if fqdn is empty
27
+ if [ -z " $fqdn " ]; then
28
+ echo " Error: fqdn is empty"
29
+ exit 1
30
+ fi
31
+
32
+ azd env set OPENAI_HOST azure_custom
33
+ azd env set AZURE_OPENAI_CUSTOM_URL $fqdn
34
+
You can’t perform that action at this time.
0 commit comments