Cannot find Chrome binary in Azure Function App (Windows) serverless environment

Kai Sor 50 Reputation points
2023-08-29T01:10:44.7933333+00:00

Hello all!

I'm trying to run Selenium tests in Azure Function App (Windows). In Visual Studio, I've included chromedriver.exe to the output directory, but when I try to run the function, this error happens.

User's image

I'm guessing Google Chrome isn't installed in the temporary drives.

This article from Anthony Chu: https://dev.to/azure/running-headless-chromium-in-azure-functions-with-puppeteer-and-playwright-2fgk mentions that installing Playwright/Puppeteer during run time will also install Chromium, allowing him to run headless Chromium in Azure Functions.

How can I achieve something similar with Selenium?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,185 questions
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
904 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,783 questions
0 comments No comments
{count} votes

Accepted answer
  1. navba-MSFT 16,610 Reputation points Microsoft Employee
    2023-08-29T05:07:23.65+00:00

    @Kai Sor Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    I understand that you are trying to run Selenium tests in an Azure Function App (Windows) and is encountering an error that suggests that Google Chrome is not installed in the temporary drives. You are looking for a way to install Chrome in the Azure Function App environment to run Selenium tests.

    On Azure function App windows this scenario may not be supported. see here. However, it should work fine on linux (with custom image) as explained in below articles.

    This article talks about Deploy Azure function with Selenium as Azure Function and How to create a Selenium web scraper in Azure Functions.

    You can also follow this article which helps in installing chromium, chrome driver and selenium on top of the Azure Function base and creating Function using docker image.

    Also refer this article which talks about Executing WebDriver Tests in Chrome via Azure Functions Hosted on Linux Docker Container.

    Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.

    **
    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful