Rayrun
← Back to Discord Forum

Playwright CI with jammy container

Anyone ever had to sign in to the az cli (service principal) or something else to get the tests running?

The current image doesn't have az cli, I was wondering if anyone had the same issue, if one just installs the az cli on the container for every build or if there's some other better way to do it!

Should I just go through https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt and install it on every run?

Thanks in advance.

This thread is trying to answer question "How to install the Azure CLI on a Playwright CI container for every build?"

6 replies

Build a new docker image with the microsoft image as a base.

Then install all necessary stuff for your azure pipeline And push that docker image to a registry.

Then use that "custom" image for runs

instead of always installing stuff in the container, just build a new image with all of the stuff pre-installed

that was also an option... wondering if this problem was already solved before I went down all the possible routes! cheers @haze.dev

No worries. there might be a simpler answer to your solution.

The one i offered is how i usually would do it 🙂

The recommendation is curl -sL https://aka.ms/InstallAzureCLIDeb | bash inside the container which should be quite fast.

I did what @mxschmitt suggested. Works fine. It's not "quite fast"... but this is a side project, doesn't hurt.

-  Install Az Client  3m 12s
-  Login to Azure     4s
-  Run Tests          1m 51s
[...]

jobs:
  build:
    name: 'Build'
    runs-on: ubuntu-latest
    container:
      image: mcr.microsoft.com/playwright/dotnet:v1.32.0-jammy
    steps:
      - uses: actions/checkout@v3
      - name: Setup dotnet
        uses: actions/setup-dotnet@v3
        with:
          dotnet-version: 7.0.x
      - run: dotnet build
      - name: Install Az Client
        run: curl -sL https://aka.ms/InstallAzureCLIDeb | bash
      - name: Login to Azure
        run: az login --service-principal --username ${{ secrets.servicePrincipalId }} --password ${{ secrets.servicePrincipalKey }} --tenant ${{ secrets.tenantId }}
      - name: Run Tests
        run: dotnet test

[...]

But works, if people are facing a similar issue and while they work on other solutions... at least, unblocks the pipeline.

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.