Skip to content

Commit 412151b

Browse files
committed
Prepping eShopOnWeb to be published to an Azure App Service
1 parent b324cb2 commit 412151b

10 files changed

+46
-20
lines changed
71.9 KB
Loading
160 KB
Loading
82.4 KB
Loading
119 KB
Loading
47.8 KB
Loading
86.7 KB
Loading
69 KB
Loading
103 KB
Loading
96.1 KB
Loading

docs/walkthroughs/deploy-to-azure-app-service-from-visual-studio.md

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,73 @@ To deploy the eShopOnWeb sample application to an Azure App Service (assuming yo
1010

1111
## 2. Right-click on the Web project in Solution Explorer and choose Publish.
1212

13-
![image](https://github.com/user-attachments/assets/0d489dfb-9e3a-4bb0-b779-7e3fe0b0d96e)
13+
![Solution Explorer is open. The context menu is shown for the Web project. Publish is highlighted.](../assets/images/walkthroughs/app-service-from-visual-studio/publish-from-web-project.jpg)
1414

15-
## 3. Choose Microsoft Azure App Service.
15+
## 3. From the Publish screen, select `+ New profile`
1616

17-
Leave the option to `Create New` selected. Click `Publish`.
17+
![The Publish tab is open. The "+ New profile" button is highlighted.](../assets/images/walkthroughs/app-service-from-visual-studio/publish-select-new-profile.jpg)
1818

19-
![image](https://github.com/user-attachments/assets/1b377746-4e21-4a4a-86db-9cfdddf27cd3)
19+
## 4. In the Publish dialog, select `Azure` as the target.
2020

21-
## 4. Choose an App Name, Subscription, Resource Group, and App Service Plan.
21+
![Publish dialog is displayed. This is the Target step. Azure is the selected target. The Next button is highlighted.](../assets/images/walkthroughs/app-service-from-visual-studio/select-publish-target.jpg)
2222

23-
Create a new Resource Group, if desired. You can specify a Free App Service Plan, if desired, as shown.
23+
## 5. Select `Azure App Service (Linux)` for the Specific target.
2424

25-
![image](https://github.com/user-attachments/assets/44700de9-bbac-44c5-9656-0fef86026d56)
25+
![Publish dialog is displayed. This is the specific target step. Azure App Service (Linux) is the selected target. The Next button is highlighted.](../assets/images/walkthroughs/app-service-from-visual-studio/specific-target-azure-app-service-linux.jpg)
2626

27-
## 5. Click Create.
27+
## 6. Select the subscription and app service.
2828

29-
The Publish profile will be saved and the eShopOnWeb sample will be published to the Azure App Service.
29+
In the upper-right corner of the dialog, select your Microsoft account. Then, select your **Subscription name**. For this walkthrough, we'll create a new App Service, so select **+ Create new**.
3030

31-
![image](https://github.com/user-attachments/assets/68f4b285-98b4-4ce0-b51c-dd0d5fd78cd7)
31+
![On the Publis dialog, confirm the Microsoft account and subscription. "+ Create new" is highlighted. ](../assets/images/walkthroughs/app-service-from-visual-studio/select-subscription.jpg)
3232

33-
Once the publish process has completed, your deployed app will launch in your browser.
33+
## 7. Add the app services details.
3434

35-
![image](https://github.com/user-attachments/assets/12c3bbdb-0e5e-4314-b6ea-86b063eb5628)
35+
On the **App Service (Linux)** dialog, make sure that the following details are correct:
3636

37-
[Learn more about Azure deployment options in the official documentation](https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-deploy).
37+
- Microsoft account
38+
- **Name** - This is for the App Service's name. This is unique for app services.
39+
- **Subscription name**
40+
- **Resource group** - If needed, create a new resource group.
41+
- **Hosting Plan** - You can create a Linux hosting plan here.
42+
43+
If all looks well, then select **Create**. This will create the Azure resources.
3844

39-
## Optional
45+
![The App Service (Linux) dialog is displayed. The settings are for the subscription, app service name, resource group, and hosting plan.](../assets/images/walkthroughs/app-service-from-visual-studio/app-service-details.jpg)
4046

41-
If you are not seeing data initially in the store, the most likely reason is that the Azure App Service is configured for `Production`, not `Development` (Note: This is not the same as `Debug` vs. `Release` configuration). The sample data is only seeded in the `Development` environment. You can configure the App Service to run in `Development` as follows:
47+
## 8. Update Azure App Settings' Environment Variables
48+
49+
In order to populate the seed data, we need to set the `ASPNETCORE_ENVIRONMENT` variable to `Development`. (Note: This is not the same as `Debug` vs. `Release` configuration). The sample data is only seeded in the `Development` environment. You can configure the App Service to run in `Development` as follows:
4250

4351
1. In the Azure Portal, navigate to your Web App.
4452

45-
1. Click Application settings.
53+
1. Select **Settings** > **Environment Variables**.
54+
55+
1. In the **App settings** section, add a new key `ASPNETCORE_ENVIRONMENT` with value `Development`.
56+
57+
1. Select **Apply**.
58+
59+
![Add the ASPNETCORE_ENVIRONMENT variable in the Azure Portal.](../assets/images/walkthroughs/app-service-from-visual-studio/azure-app-service-environment-variables.jpg)
60+
61+
## 9. Publish the app.
4662

47-
1. Scroll down to App settings.
63+
Once the Azure resources are created, the Publish dialog will appear for you to select an existing or new Azure resource. Select the new Azure App Service (Linux) that you created above. Then, select **Finish**.
4864

49-
1. Add a new key `ASPNETCORE_ENVIRONMENT` with value `Development`.
65+
![In the Publish dialog, on the App Service step. The new app service is highlighted, then the Finish button is highlighted.](../assets/images/walkthroughs/app-service-from-visual-studio/finalize-publish.jpg)
66+
67+
The Publish profile will be saved.
68+
69+
You will then need to select the **Publish** button to publish the app to the App Service.
70+
71+
![image](https://github.com/user-attachments/assets/68f4b285-98b4-4ce0-b51c-dd0d5fd78cd7)
72+
73+
Once the publish process has completed, your deployed app will launch in your browser.
74+
75+
![image](https://github.com/user-attachments/assets/12c3bbdb-0e5e-4314-b6ea-86b063eb5628)
76+
77+
[Learn more about Azure deployment options in the official documentation](https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-deploy).
5078

51-
1. Click `Save`.
5279

53-
![image](https://github.com/user-attachments/assets/89c7f1e2-6ae9-4f9c-83d9-d6a286240ef6)
5480

5581
At this point, you should be able to refresh the site and see it loaded with data (if not, publish once more from Visual Studio).
5682

0 commit comments

Comments
 (0)