- Create a resource group
- Create a staging server
- Create a GitHub Actions server
- Create a production server
- Create a deployment slot on the production server
- Set the deployment slot to 50% traffic
For this workshop we are using the Azure portal with Azure Resource Manager to manage your Azure resource groups.
A resource group is a container that holds related resources for an Azure solution. The resource group can include all the resources for the solution, or only those resources that you want to manage as a group. You decide how you want to allocate resources to resource groups based on what makes the most sense for your organization. Generally, add resources that share the same lifecycle to the same resource group so you can easily deploy, update, and delete them as a group. The resource group stores metadata about the resources. Therefore, when you specify a location for the resource group, you are specifying where that metadata is stored. For compliance reasons, you may need to ensure that your data is stored in a particular region.
-
Sign in to the Azure portal.
-
Select Resource groups
-
Select Add.
-
Enter the following values:
- Subscription: Select your Azure subscription.
- Resource group: Enter a new resource group name.
- Region: Select an Azure location, such as Central US.
Note
You should use the same resource group and location for all the resources we are creating today
-
Select Review + Create
-
Select Create. It takes a few seconds to create a resource group.
-
Select Refresh from the top menu to refresh the resource group list, and then select the newly created resource group to open it. Or select Notification(the bell icon) from the top, and then select Go to resource group to open the newly created resource group
-
In the Azure portal, select Create a resource.
-
Select New > Web App.
-
Configure the Instance Details section before configuring the App Service plan.
- Choose Java 11 for the Runtime Stack
- Choose Java SE for the Java Web Server Stack
- Choose Linux for the Operating System
This will be our Staging Web App Server.
Note
You should use the same resource group and location for all the resources we are creating today
-
In the App Service Plan section, select Create new.
-
When creating a plan, you can select the pricing tier of the new plan. In Sku and size, choose the default.
- Repeat the steps to create the Production server:
- In the App Service Plan section, use the same app service plan that you used for the staging server, instead of creating a new one.
- Include the word github in this Web App name.
- Use the same location and resource group.
- Repeat the steps to create the Production server, with the following changes:
- In the App Service Plan section, use the same app service plan that you used for the staging server, instead of creating a new one.
- Include the word Production in this Web App name.
- Use the same location and resource group.
Deployment slots are live apps with their own host names. App content and configurations elements can be swapped between two deployment slots, including the production slot.
-
In the left pane, select Deployment slots > Add Slot.
[!NOTE] If the app isn't already in the Standard, Premium, or Isolated tier, you receive a message that indicates the supported tiers for enabling staged publishing. At this point, you have the option to select Upgrade and go to the Scale tab of your app before continuing.
-
In the Add a slot dialog box, give the slot the name "Canary", and select whether to clone an app configuration from another deployment slot. Select Add to continue.
- After the slot is added, select Close to close the dialog box. The new slot is now shown on the Deployment slots page. By default, Traffic % is set to 0 for the new slot, with all customer traffic routed to the production slot.
-
Select the new deployment slot to 50%,
-
Open that slot's resource page.
The staging slot has a management page just like any other App Service app. You can change the slot's configuration. To remind you that you're viewing the deployment slot, the app name is shown as <app-name>/<slot-name>, and the app type is App Service (Slot). You can also see the slot as a separate app in your resource group, with the same designations.
-
Select the app URL on the slot's resource page. The deployment slot has its own host name and is also a live app.