Announcing Snippets and Traffic Splitting for Azure Static Web Apps #1310
Replies: 3 comments 6 replies
-
Hello, I was hoping to add the code found here to get more analytics for my static web app https://learn.microsoft.com/en-us/azure/azure-monitor/app/javascript-sdk?tabs=javascriptwebsdkloaderscript however the code is over the 2048 characters limit and I cannot add the snippet. |
Beta Was this translation helpful? Give feedback.
-
@thomasgauvin Is there a way to automate the deployment of snippets via bicep/arm or az cli? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Also need a way to configure Traffic splitting via Az PowerShell and/or CLI, so it can be automated through the pipeline. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
We’re excited to announce two new features, Snippets and Traffic Splitting, to improve your development workflows and improve development productivity! 🎉
Snippets:
With snippets for Azure Static Web Apps, you can specify code that will be injected into each page of your website without having to change your application’s source code. Snippets are configured on the Static Web Apps resource and get injected at runtime by the Static Web Apps host (when the site is being served).
When providing your snippet, you can indicate which environment it should be applied to, and you can configure the code snippet to be appended or prepended to the head or the body or your website’s pages.
Snippets can be used to add analytics scripts to each page of your website, enabling you to track website performance and engagement. They can also be used to add global UI elements which are shared across multiple pages, such as navigation menus, banners or shared JavaScript code for dynamic behavior such as chat widgets or pop-ups.
Traffic splitting:
Traffic Splitting enables you to share traffic to your Azure Static Web Apps across and specify the amount of traffic share each environment receives. This feature allows you to gradually roll out new versions of your site and test different versions with real users.
For example, you can use traffic splitting to gradually roll out changes to your site without affecting all users at once, which can reduce the risk of errors or negative feedback and allow you to adjust quickly. Traffic splitting can also be used to implement A/B testing, whereby separate versions of your website are served across your users and analytics are used to determine the impact on performance of various changes.
Try it out & let us know what you think!
You can access Snippets from the Configuration tab of your Static Web Apps resource in the Azure Portal, and you can access Traffic Splitting from the Environments tab. We’re constantly listening for feedback so let us know what you think!
Check out our docs to get started with Snippets and Traffic Splitting 🚀
Beta Was this translation helpful? Give feedback.
All reactions