06 - CI/CD (Consumption)¶
Automate build and deployment of your Consumption (Y1) 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.
See Also¶
- Tutorial Overview & Plan Chooser
- PowerShell Language Guide
- Platform: Hosting Plans
- Operations: Deployment
- Recipes Index
Sources¶
- PowerShell developer reference (Microsoft Learn)
- Azure Functions Consumption plan (Microsoft Learn)
- Run Functions locally with Core Tools (Microsoft Learn)
Legacy hosting path
Consumption plan (Y1) content is provided for existing workloads. For most new serverless applications, prefer Flex Consumption.