Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/CAdeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@ jobs:
# Install azd (Azure Developer CLI) - required by process_sample_data.sh
curl -fsSL https://aka.ms/install-azd.sh | bash

# Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ
current_date=$(date -u +"%Y-%m-%dT%H:%M:%S.%7NZ")

DEPLOY_OUTPUT=$(az deployment group create \
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
--template-file infra/main.bicep \
--parameters location=${{ env.AZURE_LOCATION }} azureAiServiceLocation=${{ env.AZURE_LOCATION }} solutionName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptModelCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} imageTag=${{ env.IMAGE_TAG }} createdBy="Pipeline" \
--parameters location=${{ env.AZURE_LOCATION }} azureAiServiceLocation=${{ env.AZURE_LOCATION }} solutionName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptModelCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} imageTag=${{ env.IMAGE_TAG }} createdBy="Pipeline" tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}" \
--query "properties.outputs" -o json)

echo "Deployment output: $DEPLOY_OUTPUT"
Expand Down
74 changes: 36 additions & 38 deletions .github/workflows/azure-dev.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
name: Azure Template Validation
on:
push:
branches:
- main
- dev
workflow_dispatch:

permissions:
contents: read
id-token: write
pull-requests: write

jobs:
template_validation_job:
name: Azure Template Validation
on:
workflow_dispatch:
push:
branches:
- main
permissions:
contents: read
id-token: write
pull-requests: write
jobs:
template_validation_job:
runs-on: ubuntu-latest
environment: production
runs-on: ubuntu-latest
name: Template validation

steps:
# Step 1: Checkout the code from your repository
- name: Checkout code
uses: actions/checkout@v4

# Step 2: Validate the Azure template using microsoft/template-validation-action
- name: Validate Azure Template
uses: microsoft/template-validation-action@v0.3.5
id: validation
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Step 3: Print the result of the validation
- name: Print result
run: cat ${{ steps.validation.outputs.resultFile }}
name: Template validation
steps:
# Step 1: Checkout the code from your repository
- name: Checkout code
uses: actions/checkout@v4
# Step 2: Validate the Azure template using microsoft/template-validation-action
- name: Validate Azure Template
uses: microsoft/template-validation-action@v0.4.2
id: validation
with:
useDevContainer: false
validateTests: ''
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Step 3: Print the result of the validation
- name: Print result
run: cat ${{ steps.validation.outputs.resultFile }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Quick deploy
### How to install or deploy
Follow the quick deploy steps on the deployment guide to deploy this solution to your own Azure subscription.

> **Note:** This solution accelerator requires **Azure Developer CLI (azd) version 1.18.0 or higher**. Please ensure you have the latest version installed before proceeding with deployment. [Download azd here](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd).

[Click here to launch the deployment guide](./docs/DeploymentGuide.md)
<br/><br/>

Expand Down
2 changes: 1 addition & 1 deletion azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: build-your-own-copilot-solution-accelerator

requiredVersions:
azd: ">= 1.15.0"
azd: ">= 1.18.0"

metadata:
template: build-your-own-copilot-solution-accelerator@1.0
Expand Down
94 changes: 94 additions & 0 deletions docs/ACRBuildAndPushGuide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Azure Container Registry (ACR) – Build & Push Guide

This guide provides step-by-step instructions to build and push Docker images for **WebApp** and **Backend** services into Azure Container Registry (ACR).

## 📋 Prerequisites
Before starting, ensure you have:
- An active [Azure Subscription](https://portal.azure.com/)
- [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) installed and logged in
- [Docker Desktop](https://docs.docker.com/get-docker/) installed and running
- Access to your Azure Container Registry (ACR)
- To create an Azure Container Registry (ACR), you can refer to the following guides:

- [Create Container Registry using Azure CLI](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-azure-cli)

- [Create Container Registry using Azure Portal](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal?tabs=azure-cli)

- [Create Container Registry using PowerShell](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-powershell)

- [Create Container Registry using ARM Template](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-geo-replication-template)

- [Create Container Registry using Bicep](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-bicep?tabs=CLI)

---

Login to ACR :
``` bash
az acr login --name $ACR_NAME
```

## 🚀 Build and Push Images

**Backend :**

```bash
az acr login --name <containerregname>
docker build --no-cache -f docker/Backend.Dockerfile -t <acrloginserver>/<repo>:<tagname> .
docker push <acrloginserver>/<repo>:<tagname>
```

If you want to update image tag and image manually you can follow below steps:
- Go to your **Container App** in the [Azure Portal](https://portal.azure.com/#home).
- In the left menu, select **Containers**.
- Under your container, update:

- Image source → Azure Container Registry / Docker Hub.

- Image name → myapp/backend.

- Tag → change to the new one you pushed (e.g., v2).

- Click **Save** → this will create a new revision automatically with the updated image.

![alt text](./images/ContainerApp.png)

**WebApp :**

```bash
az acr login --name <containerregname>
docker build --no-cache -f docker/Frontend.Dockerfile -t <acrloginserver>/<repo>:<tagname> .
docker push <acrloginserver>/<repo>:<tagname>
```

If you want to update image tag and image manually you can follow below steps:
- Go to your App Service in the [Azure Portal](https://portal.azure.com/#home).
- In the left menu, select Deployment → Deployment Center
- Under Container settings, you can configure:

- Image Source → (e.g., Azure Container Registry / Docker Hub / Other).

- Image Name → e.g., myapp/backend.

- Tag → e.g., v1.2.3.

![alt text](./images/AppServiceContainer.png)


## ✅ Verification

Run the following command to verify that images were pushed successfully:
```bash
az acr repository list --name $ACR_NAME --output table
```

You should see repositories in the output.

## 📝 Notes

- Always use meaningful tags (v1.0.0, staging, prod) instead of just latest.

- If you are pushing from a CI/CD pipeline, make sure the pipeline agent has access to Docker and ACR.

- For private images, ensure your services (e.g., Azure Container Apps, AKS, App Service) are configured with appropriate ACR pull permissions.


3 changes: 2 additions & 1 deletion docs/DeploymentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ If you're not using one of the above options for opening the project, then you'l

1. Make sure the following tools are installed:
- [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) <small>(v7.0+)</small> - available for Windows, macOS, and Linux.
- [Azure Developer CLI (azd)](https://aka.ms/install-azd) <small>(v1.15.0+)</small> - version
- [Azure Developer CLI (azd)](https://aka.ms/install-azd) <small>(v1.18.0+)</small> - version
- [Python 3.9 to 3.11](https://www.python.org/downloads/)
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
- [Git](https://git-scm.com/downloads)
Expand Down Expand Up @@ -213,6 +213,7 @@ Once you've opened the project in [Codespaces](#github-codespaces), [Dev Contain
```shell
azd up
```
> **Note:** This solution accelerator requires **Azure Developer CLI (azd) version 1.18.0 or higher**. Please ensure you have the latest version installed before proceeding with deployment. [Download azd here](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd).

3. Provide an `azd` environment name (e.g., "byocaapp").
4. Select a subscription from your Azure account and choose a location that has quota for all the resources.
Expand Down
Loading
Loading