Skip to content

Commit f4a6449

Browse files
committed
Fix Azure ContainerApps deployment -a option
1 parent 499cfd2 commit f4a6449

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

scripts/create-azure-openai-resources.sh

+2-10
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ RESOURCE_GROUP="rg-super-heroes"
4343
LOCATION="eastus"
4444
TAG="super-heroes"
4545
MODEL="gpt-35-turbo"
46-
MODEL_VERSION="0301"
46+
MODEL_VERSION="0613"
4747
UNIQUE_IDENTIFIER=$(whoami)
4848

4949
# Process the input options
@@ -147,13 +147,6 @@ AZURE_OPENAI_KEY=$(
147147
| jq -r .key1
148148
)
149149

150-
AZURE_OPENAI_ENDPOINT=$(
151-
az cognitiveservices account show \
152-
--name "$COGNITIVE_SERVICE" \
153-
--resource-group "$RESOURCE_GROUP" \
154-
| jq -r .properties.endpoint
155-
)
156-
157150
echo
158151
echo "Deployment took $SECONDS seconds to complete."
159152
echo
@@ -162,7 +155,6 @@ echo "[$(date +"%m/%d/%Y %T")]: All services have been deployed"
162155
echo "-----------------------------------------"
163156
echo "Here are some key values you may need to use in your application's configuration:"
164157
echo
165-
echo "API key (quarkus.langchain4j.azure-openai.api-key: $AZURE_OPENAI_KEY"
166-
echo "Endpoint: $AZURE_OPENAI_ENDPOINT"
158+
echo "API key (quarkus.langchain4j.azure-openai.api-key): $AZURE_OPENAI_KEY"
167159
echo "Resource Name (quarkus.langchain4j.azure-openai.resource-name): $COGNITIVE_SERVICE"
168160
echo "Deployment Name/Id (quarkus.langchain4j.azure-openai.deployment-id): $COGNITIVE_DEPLOYMENT"

scripts/deploy-to-azure-containerapps.sh

+6-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ help() {
1616
echo "Syntax: deploy-to-azure-containerapps.sh [options]"
1717
echo "options:"
1818
echo " -a Create Azure OpenAI resources and bind to the narration service"
19-
echo " By default this is not created and the narration service will server a default narration on all requests."
19+
echo " By default this is not created and the narration service will serve a default narration on all requests."
2020
echo " -g <resource_group_name> Name of the Azure resource group to use to deploy resources"
2121
echo " Default: 'super-heroes'"
2222
echo " -h Prints this help message"
@@ -316,16 +316,16 @@ create_narration_app() {
316316
az containerapp create \
317317
--resource-group "$RESOURCE_GROUP" \
318318
--tags system="$TAG_SYSTEM" application="$NARRATION_APP" \
319-
--image "$NARRATION_IMAGE" \
319+
--image "${NARRATION_IMAGE}-azure-openai" \
320320
--name "$NARRATION_APP" \
321321
--environment "$CONTAINERAPPS_ENVIRONMENT" \
322322
--ingress external \
323323
--target-port 8087 \
324324
--min-replicas 1 \
325-
--env-vars NARRATION_AZURE_OPEN_AI_ENABLED=true \
326-
NARRATION_AZURE_OPEN_AI_KEY="$AZURE_OPENAI_KEY" \
327-
NARRATION_AZURE_OPEN_AI_ENDPOINT="$AZURE_OPENAI_ENDPOINT" \
328-
NARRATION_AZURE_OPEN_AI_DEPLOYMENT_NAME="$NARRATION_COGNITIVE_SERVICE_DEPLOYMENT_NAME"
325+
--env-vars QUARKUS_PROFILE=azure-openai \
326+
QUARKUS_LANGCHAIN4J_AZURE_OPENAI_API_KEY="$AZURE_OPENAI_KEY" \
327+
QUARKUS_LANGCHAIN4J_AZURE_OPENAI_RESOURCE_NAME="$NARRATION_COGNITIVE_SERVICE" \
328+
QUARKUS_LANGCHAIN4J_AZURE_OPENAI_DEPLOYMENT_ID="$NARRATION_COGNITIVE_SERVICE_DEPLOYMENT_NAME"
329329
else
330330
az containerapp create \
331331
--resource-group "$RESOURCE_GROUP" \
@@ -435,13 +435,6 @@ create_azure_openai_resources() {
435435
--resource-group "$RESOURCE_GROUP" \
436436
| jq -r .key1
437437
)
438-
439-
AZURE_OPENAI_ENDPOINT=$(
440-
az cognitiveservices account show \
441-
--name "$NARRATION_COGNITIVE_SERVICE" \
442-
--resource-group "$RESOURCE_GROUP" \
443-
| jq -r .properties.endpoint
444-
)
445438
}
446439

447440
# Define defaults

0 commit comments

Comments
 (0)