Share via

Get source map from AzureStaticWebApp@0 task to unminify code in Application Insights

R Graham 0 Reputation points
2024-05-28T19:20:13.4333333+00:00

I am using the application insights JavaScript SDK in a React application that is hosted on Static Web Apps. The app is built and deployed using the AzureStaticWebApp@0 task in an AzDO pipeline. I would like to be able to un-minify the stack traces in Application Insights so that I can properly troubleshoot frontend errors, however, the AzureStaticWebApp@0 task does not appear to generate a source map I can link my App Insights instance to.

Azure Monitor
Azure Monitor

An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.

Azure Static Web Apps
Azure Static Web Apps

An Azure service that provides streamlined full-stack web app development.

0 comments No comments

1 answer

Sort by: Most helpful
  1. hossein jalilian 13,360 Reputation points Volunteer Moderator
    2024-05-28T19:31:10.2433333+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    The Azure DevOps pipelines does not automatically generate or upload source maps to Azure Blob Storage.

    There are a few potential solutions you can explore:

    • Generate Source Maps Manually: Most modern JavaScript bundlers and build tools, such as Webpack or Rollup, have the capability to generate source maps during the build process.
    • Use a Custom Build Task: Create a custom build task in your Azure DevOps pipeline that generates source maps and uploads them to an Azure Blob Storage container.
    • Leverage Azure Static Web Apps GitHub Action: You can configure your React application to be deployed using the official Azure Static Web Apps GitHub Action. This action supports generating and uploading source maps to Azure Blob Storage during the deployment process.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.