Azure Functions Deployment
Deploy your Synthetic Monitoring solution to Azure in 4 simple phases.
Phase 1: Create Azure Resources
1. Create Function App
- Azure Portal → Create Resource → Function App
-
Configure:
- Name:
synthetic-monitoring-func-prod
- Runtime: Node.js 18
- Plan: Functions Premium (production)
- Storage: Create new
- Application Insights: Enable
- Name:
2. Create Storage Account (for artifacts)
- Azure Portal → Storage Accounts → Create
-
Configure:
- Name:
syntheticartifacts[suffix]
- Performance: Standard
- Create container:
test-artifacts
- Name:
3. Get Connection Strings
- Application Insights: Properties → Connection String
- Storage Account: Access Keys → Connection String
Phase 2: Configure Function App
Add these variables in Function App → Settings → Environment Variables:
APPLICATIONINSIGHTS_CONNECTION_STRING=[App Insights Connection String]
AZURE_STORAGE_CONNECTION_STRING=[Storage Account Connection String]
BLOB_CONTAINER_NAME=test-artifacts
baseUrl=https://your-target-application.com
SYNTHETIC_MONITOR_SCHEDULE=0 */5 * * * *
... others env variables
Phase 3: Setup Azure DevOps Pipeline
1. Create Build Pipeline
Create azure-pipelines.yml
in your repo:
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '18.x'
- script: npm ci
displayName: 'Install dependencies'
- script: npx playwright install --with-deps chromium
displayName: 'Install Playwright'
- script: npm run build
displayName: 'Build TypeScript'
- task: ArchiveFiles@2
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/function-app.zip'
includeRootFolder: false
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'function-app'
Or classic mode
2. Create Release Pipeline
- Pipelines → Releases → New Pipeline
- Add Artifact: Link to build pipeline
- Add Stage: Deploy to Function App
-
Configure Task:
- Azure Function App Deploy
- App Service name:
synthetic-monitoring-func-prod
- Package:
$(System.DefaultWorkingDirectory)/_[BuildName]/function-app/function-app.zip
Phase 3: Deploy and Monitor
1. Deploy
- Commit code → Build runs automatically
- Release pipeline → Deploy to Function App
- Verify function is running in Azure Portal
2. Monitor
- Application Insights → Live Metrics (real-time monitoring)
- Function App → Monitoring → Log Stream (logs in real time)
- Function App → Functions → syntheticMonitorFunctionName (execution history)
- Storage Account → test-artifacts (uploaded reports on failures)
Quick Checklist
- [ ] Function App created with Application Insights
- [ ] Storage Account created with container
- [ ] Connection strings configured in Function App
- [ ] Build pipeline runs successfully
- [ ] Release pipeline deploys to Function App
- [ ] Function executes and sends telemetry
- [ ] Test artifacts upload on failures
Top comments (0)