Skip to content

[BUG] Screenshot images fail to render in test run reports β€” duplicate SAS token parameters in image URLsΒ #44

@nsierraj

Description

@nsierraj

🐞 Describe the bug

When viewing test run results in the Azure portal (Playwright Workspaces reporting), screenshot images fail to render (broken image icons), while trace thumbnails render correctly. The root cause is that the SAS token query parameters are being appended twice to the screenshot image URLs, causing Azure Storage to reject the request with an AuthenticationFailed error.

βœ… Expected behavior

Screenshot images should render inline in the test run report.

πŸ” To reproduce

  1. Configure a Playwright Workspace with reporting enabled and a linked storage account
  2. Configure playwright.service.config.ts with the HTML and Azure reporters:
reporter: [
     ["html", { open: "never" }],
     ["@azure/playwright/reporter"],
   ]
  1. Configure playwright.config.ts with screenshot capture:
use: {
     trace: 'on-first-retry',
     video: 'retain-on-failure',
     screenshot: 'on'
   }

  1. Run tests that produce screenshots using Entra ID authentication
  2. Open the test run in the Azure portal β†’ Test runs page
  3. Observe the Screenshots section

πŸ“Έ Screenshots (if applicable)

Add any relevant screenshots or logs to help explain your problem.

🧩 Setup information

Please provide the following details to help us investigate:

Example of the broken URL:

https://<storageaccount>.blob.core.windows.net/<container>/<run-id>/data/<hash>.png
  ?sv=2020-12-06&st=...&se=...&sr=c&sp=rl&spr=https&skoid=...&sktid=...&skt=...&ske=...&sks=b&skv=2020-12-06&sig=...
  &sv=2020-12-06&st=...&se=...&sr=c&sp=rl&spr=https&skoid=...&sktid=...&skt=...&ske=...&sks=b&skv=2020-12-06&sig=...

Note: the second &sv=2020-12-06 and all subsequent parameters are exact duplicates of the first set.

Error returned by Azure Storage

<Code>AuthenticationFailed</Code>
<Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.</Message>
<AuthenticationErrorDetail>sv is either not in the correct format or is not equal or later than version 2012-02-12</AuthenticationErrorDetail>

πŸ—’οΈ Additional context

Add any other context or details that might help us reproduce or diagnose the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions