Skip to content

06 - CI/CD (Flex Consumption)

Automate build and deployment of your Flex Consumption (FC1) PowerShell app with GitHub Actions.

Workflow

name: deploy-powershell-functions

on:
  push:
    branches: [main]

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Bundle PowerShell modules
        shell: pwsh
        run: |
          Save-Module -Name Az.Accounts -Path ./Modules

      - name: Azure login
        uses: azure/login@v2
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: Deploy to Azure Functions
        uses: Azure/functions-action@v1
        with:
          app-name: func-ps-demo
          package: .

Verification

Push to main and confirm the workflow completes green in the Actions tab, then curl the deployed endpoint.

Next Steps

Extend beyond HTTP with additional trigger types.

Next: 07 - Extending with Triggers

See Also

Sources