Session B: Professional Project Setup & MLOps Foundation Defining and tracking Project Goals Effective Git workflow (branching, pull requests) Introduction to CI/CD pipelines with GitHub Actions
- Discuss the following as first approach on monitoring our project
- Go through and follow the steps
- Spend time on ci_pipeline.yalm and on how the process actually runs
📝 Note: Your public profile must be download from your azrure portal and be set as a secret variable in your github repos
- Steps
- Go to your Azure Function App in the Azure Portal.
- Navigate to Deployment Center > Manage publish profile.
- Download the profile and copy its contents.
- In GitHub, go to your repo’s Settings > Secrets and variables > Actions -> New Repository Secrets
- Create a new secret named AZURE_FUNCTIONAPP_PUBLISH_PROFILE and paste the profile contents
This project sets up a CI/CD pipeline for deploying a Python-based Azure Function using GitHub Actions. The goal is to automate code checks and deployment to Azure upon each push to the main branch.
-
Create Azure Function App
- [✅] Set up the Function App in Azure
- [✅] Configure Python runtime
-
Initialize Git Repository
- Add source code and config files
- Include
.gitignore
for Python/Azure
-
Set Up CI/CD Workflow
- Use GitHub Actions or other CI/CD tool
- Trigger workflow on push to
main
-
Add Code Quality Checks
- Integrate
flake8
,black
, orpylint
- Fail pipeline if checks fail
- Integrate
-
Run Unit Tests
- Add test suite (
pytest
,unittest
) - Run tests in CI/CD pipeline
- Add test suite (
-
Deploy to Azure
- Use
azure/functions-action
or Azure CLI - Deploy only if checks/tests pass
- Use
-
Secure Secrets
- Store credentials in GitHub Secrets
- Use secrets in workflow securely
-
Enable Monitoring
- Configure logging in Azure
- Optionally integrate Application Insights