1
1
#! /bin/sh
2
2
3
- # To set up AZD environment variabless
3
+ # To set up AZD environment variabless
4
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
5
6
+ # Fill in your resource group name and container app name:
9
7
resourceGroupName=" your-resource-group-name"
10
8
containerAppName=" your-container-app-name"
11
9
10
+ if [ -z " $( az account show) " ]; then
11
+ echo " You are not logged in. Please run 'az login' or 'az login --use-device-code' first."
12
+ exit 1
13
+ fi
14
+
15
+ echo " Running provisioning using this subscription:"
16
+ az account show --query " {subscriptionId:id, name:name}"
17
+ echo " If that is not the correct subscription, please run 'az account set --subscription \" <SUBSCRIPTION-NAME>\" '"
18
+
12
19
# Check if resourceGroupName is empty
13
20
if [ -z " $resourceGroupName " ]; then
14
21
echo " Error: resourceGroupName is empty"
@@ -21,7 +28,8 @@ if [ -z "$containerAppName" ]; then
21
28
exit 1
22
29
fi
23
30
24
- fqdn=$( az container show --name $containerAppName --resource-group $resourceGroupName --query ipAddress.fqdn --output tsv)
31
+ fqdn=$( az containerapp show --name $containerAppName --resource-group $resourceGroupName --query properties.configuration.ingress.fqdn --output tsv)
32
+ fqdn=" https://$fqdn "
25
33
26
34
# Check if fqdn is empty
27
35
if [ -z " $fqdn " ]; then
31
39
32
40
azd env set OPENAI_HOST azure_custom
33
41
azd env set AZURE_OPENAI_CUSTOM_URL $fqdn
34
-
42
+ echo " Successfully set OPENAI_HOST to azure_custom and AZURE_OPENAI_CUSTOM_URL to $fqdn "
0 commit comments