Running a Playwright scheduled job with Azure Container Apps
Monday, June 10, 2024
In my last post on how to deploy a serverless Playwright app to Azure Container Apps, I promised that I'd write a follow-up article "soon" on how to run Playwright in Azure Container Apps using a scheduled job. Well, it's been almost nine months, but here we are!
Azure Container Apps jobs
There are two types of resources in Azure Container Apps: apps and jobs. Apps are long-running services that respond to HTTP requests or events. Jobs are tasks that run to completion and can be triggered by a schedule or an event.
It's easy to build a job. It can be any process that you can put into a container image. Today, we'll use Node.js to create a Playwright job that runs every five minutes. Each time it runs, it'll do the following:
- Open a browser
- Navigate to Playwright's home page
- Navigate to a few other pages
- Output the these metrics to Application Insights:
- The time it took to navigate to each page
- The Playwright website's availability, as determined by whether all the pages loaded successfully
- Save a video recording of the browser session to Azure Storage

In my last post on how to deploy a serverless Playwright app to Azure Container Apps, I promised that I'd write a follow-up article "soon" on how to run Playwright in Azure Container Apps using a scheduled job. Well, it's been almost nine months, but here we are!
Azure Container Apps jobs
There are two types of resources in Azure Container Apps: apps and jobs. Apps are long-running services that respond to HTTP requests or events. Jobs are tasks that run to completion and can be triggered by a schedule or an event.
It's easy to build a job. It can be any process that you can put into a container image. Today, we'll use Node.js to create a Playwright job that runs every five minutes. Each time it runs, it'll do the following:
- Open a browser
- Navigate to Playwright's home page
- Navigate to a few other pages
- Output the these metrics to Application Insights:
- The time it took to navigate to each page
- The Playwright website's availability, as determined by whether all the pages loaded successfully
- Save a video recording of the browser session to Azure Storage



