|
| 1 | +--- |
| 2 | +title: Traffic Splitting in Azure Static Web Apps (preview) |
| 3 | +description: Learn to divert traffic from one branch to another. |
| 4 | +services: static-web-apps |
| 5 | +author: craigshoemaker |
| 6 | +ms.service: static-web-apps |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 07/10/2023 |
| 9 | +ms.author: cshoe |
| 10 | +--- |
| 11 | + |
| 12 | +# Traffic Splitting in Azure Static Web Apps (preview) |
| 13 | + |
| 14 | +Traffic splitting allows you to divert a percentage of traffic to different [branch environments](./branch-environments.md). |
| 15 | + |
| 16 | +Traffic splitting is only available on the [Standard hosting plan](plans.md). |
| 17 | + |
| 18 | +## Split traffic |
| 19 | + |
| 20 | +Before you can split traffic between branches, you first need to have open pull requests to create separate environments. |
| 21 | + |
| 22 | +To split traffic among different environments, use the following steps: |
| 23 | + |
| 24 | +1. Open your static web app in the Azure portal. |
| 25 | + |
| 26 | +1. From the *Settings* section, select **Environments**. |
| 27 | + |
| 28 | +1. Select the **Traffic splitting** tab. |
| 29 | + |
| 30 | +1. Select the **Add** button to create a new row in the traffic mapping table. |
| 31 | + |
| 32 | +1. From the dropdown, select name of the pull request you want to target. |
| 33 | + |
| 34 | +1. Enter the percentage amount of traffic you want to allocate among the different environments. |
| 35 | + |
| 36 | + Adjust the values in each of the input boxes in the *Traffic* column so the total equals 100%. |
| 37 | + |
| 38 | +1. Select **Save** to commit your changes. |
| 39 | + |
| 40 | +## Disable traffic splitting |
| 41 | + |
| 42 | +To disable traffic splitting, select the **Traffic splitting** to open the settings window. |
| 43 | + |
| 44 | +Remove all nonproduction environments from the list and save your changes. |
| 45 | + |
| 46 | +## Next steps |
| 47 | + |
| 48 | +> [!div class="nextstepaction"] |
| 49 | +> [Use preview environments](preview-environments.md) |
0 commit comments