Skip to content

Create 021 lab

Create 021 lab #1

name: Deploy Docker Image to Azure Function
on:
push:
paths:
- '021-GithubActionDockerImageFunctionCD/**'
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
deploy:
name: Deploy to Azure Function
runs-on: ubuntu-latest
steps:
# Step 1: Log in to Azure
- name: Log in to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
# Step 2: Deploy the Docker image to Azure Function
- name: Deploy to Azure Function
run: |
az functionapp config container set \
--name ${{ vars.FUNCTION_APP_NAME }} \
--resource-group ${{ vars.RESOURCE_GROUP_NAME }} \
--docker-custom-image-name ${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}