Skip to content

Commit

Permalink
Move ACA build to azd (#196)
Browse files Browse the repository at this point in the history
* Move ACA build to azd

* fix/ service naming
  • Loading branch information
nitya authored Oct 25, 2024
1 parent 1a8b83f commit a6a742e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
7 changes: 7 additions & 0 deletions azure.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: contoso-chat-openai-prompty
metadata:
template: [email protected]
services:
aca:
project: ./src/api
language: python
host: containerapp
docker:
remoteBuild: true
hooks:
postprovision:
posix:
Expand Down
2 changes: 1 addition & 1 deletion infra/ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ deployments:
version: "1106-Preview"
sku:
name: "Standard"
capacity: 10
capacity: 8
6 changes: 0 additions & 6 deletions infra/hooks/postprovision.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/usr/bin/env pwsh

Write-Output "Building contosochatapi:latest..."
az acr build --subscription $env:AZURE_SUBSCRIPTION_ID --registry $env:AZURE_CONTAINER_REGISTRY_NAME --image contosochatapi:latest ./src/api/
$image_name = $env:AZURE_CONTAINER_REGISTRY_NAME + '.azurecr.io/contosochatapi:latest'
az containerapp update --subscription $env:AZURE_SUBSCRIPTION_ID --name $env:SERVICE_ACA_NAME --resource-group $env:AZURE_RESOURCE_GROUP --image $image_name
az containerapp ingress update --subscription $env:AZURE_SUBSCRIPTION_ID --name $env:SERVICE_ACA_NAME --resource-group $env:AZURE_RESOURCE_GROUP --target-port 80

Write-Host "Starting postprovisioning..."

# Retrieve service names, resource group name, and other values from environment variables
Expand Down
7 changes: 0 additions & 7 deletions infra/hooks/postprovision.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
#!/bin/bash

echo "Building contosochatapi:latest..."
az acr build --subscription ${AZURE_SUBSCRIPTION_ID} --registry ${AZURE_CONTAINER_REGISTRY_NAME} --image contosochatapi:latest ./src/api/
image_name="${AZURE_CONTAINER_REGISTRY_NAME}.azurecr.io/contosochatapi:latest"
az containerapp update --subscription ${AZURE_SUBSCRIPTION_ID} --name ${SERVICE_ACA_NAME} --resource-group ${AZURE_RESOURCE_GROUP} --image ${image_name}
az containerapp ingress update --subscription ${AZURE_SUBSCRIPTION_ID} --name ${SERVICE_ACA_NAME} --resource-group ${AZURE_RESOURCE_GROUP} --target-port 80


# Retrieve service names, resource group name, and other values from environment variables
resourceGroupName=$AZURE_RESOURCE_GROUP
searchService=$AZURE_SEARCH_NAME
Expand Down

0 comments on commit a6a742e

Please sign in to comment.