Skip to content

ks6088ts-labs/azure-ai-services-solutions

Repository files navigation

test infra docker docker-release

azure-ai-services-solutions

This repository contains a collection of solutions that leverage Azure AI services.

Prerequisites

Architecture

architecture

Development instructions

Local development

Use Makefile to run the project locally.

# Launch backend API server
make backend

# Launch frontend app server
make frontend

# Azure Functions
make azure-functions-start

Docker development

See the actual implementation in the compose.yaml file.

# Launch backend API server
docker compose up backend

# Launch frontend app server
docker compose up frontend

Run local test

Currently almost all tests won't run on CI because it consumes Azure resources. To run the tests locally, follow the steps below.

# Run test if RUN_TEST is defined
export RUN_TEST=1

make test

Deployment instructions

# Deploy Azure resources via Bicep
cd infra
make deploy

Azure Functions are deployed using the following commands.

# Deploy Azure Functions
make azure-functions-deploy
# Publish Azure Functions
make azure-functions-publish

Push docker image to Docker Hub

To publish the docker image to Docker Hub via GitHub Actions, you need to set the following secrets in the repository.

gh secret set DOCKERHUB_USERNAME --body $DOCKERHUB_USERNAME
gh secret set DOCKERHUB_TOKEN --body $DOCKERHUB_TOKEN

Continuous Integration

To configure OIDC authentication, run the following command.

# Configure OIDC authentication
sh scripts/configure-oidc-github.sh

# Register parameters to GitHub Secrets
AZURE_SUBSCRIPTION_ID=$(az account show --query 'id' --output tsv)

gh secret set AZURE_CLIENT_ID --body $AZURE_CLIENT_ID
gh secret set AZURE_TENANT_ID --body $AZURE_TENANT_ID
gh secret set AZURE_SUBSCRIPTION_ID --body $AZURE_SUBSCRIPTION_ID
gh secret set AZURE_RG --body $AZURE_RG