This extension uploads a source map and its minified JavaScript file to elmah.io. With the files in place, elmah.io can translate bundled and minified JavaScript stack traces back to your original source.
The task works in YAML pipelines and classic release pipelines, on Windows, Linux, and macOS agents.
Open the elmah.io Upload Source Map extension on the Azure DevOps Marketplace and click Get it free:
Select your organization and click Install:
You need:
- An API key (Where is my API key?) with the
sourcemaps_writepermission (How to configure API key permissions). - The ID (Where is my log ID?) of the log the source map belongs to.
- An agent running version 3.232.1 or newer. Microsoft-hosted agents already do.
Add the task after the step that builds your JavaScript bundle:
steps:
# other steps
- task: ElmahIoUploadSourceMap@5
inputs:
apiKey: 'API_KEY'
logId: 'LOG_ID'
path: '/bundles/sharedbundle.min.js'
sourceMap: '$(System.DefaultWorkingDirectory)/myproject/drop/bundles/sharedbundle.map'
minifiedJavaScript: '$(System.DefaultWorkingDirectory)/myproject/drop/bundles/sharedbundle.min.js'You can also add the task from the assistant. Click Show assistant, search for 'elmah.io upload', and select the elmah.io Upload Source Map task:
Store the API key as a secret pipeline variable and reference it as $(ElmahIoApiKey) instead of writing it into the YAML.
Add the elmah.io Upload Source Map task to your release pipeline, choose task version 5.*, and fill in the fields:
| Input | Required | Description |
|---|---|---|
apiKey |
Yes | An elmah.io API key with the sourcemaps_write permission. |
logId |
Yes | The ID of the log that should contain the minified JavaScript and source map. |
path |
Yes | The URL of the minified JavaScript file as it is served online. It can be absolute or relative, and elmah.io always reduces it to a relative path without protocol, domain, or query string. elmah.io uses this path to find the lines in a stack trace that need translating. |
sourceMap |
Yes | The path to the source map file. Only files with the extension .map are accepted, up to 5 MB. |
minifiedJavaScript |
Yes | The path to the minified JavaScript file. Only files with the extension .js are accepted, up to 1 MB. |
Change ElmahIoUploadSourceMap@4 to ElmahIoUploadSourceMap@5, or pick task version 5.* in a release pipeline. Version 4 does not run on Linux agents. Version 5 runs on Windows, Linux, and macOS agents and requires agent 3.232.1 or newer. The inputs are the same.
Version 5 fails the step if elmah.io rejects the upload, for example because of a missing permission or a file with the wrong extension. The error message from elmah.io is shown in the step log.



