|
1 | 1 | This guided project consists of the following exercises: |
2 | 2 |
|
3 | | - - Create storage account and enable hosting |
4 | | - - **Upload and verify site content** |
5 | | - - Update the site content |
| 3 | +- Exercise 1: Create storage account and enable hosting |
| 4 | +- **Exercise 2: Upload and verify site content** |
| 5 | +- Exercise 3: Update the site content |
| 6 | +- Clean up resources |
6 | 7 |
|
7 | | -In this exercise, you create an HTML page and a custom error page, upload both to the $web container, and visit your live site to confirm everything works. This is where your static website goes from an empty endpoint to a real page that anyone can visit. |
| 8 | +In this exercise, you create an HTML page and a custom error page, upload both to the $web container, and visit your live site to confirm everything works. |
8 | 9 |
|
9 | | -This exercise includes the following tasks: |
| 10 | +The exercise consists of the following tasks: |
10 | 11 |
|
11 | | - - Create the HTML file locally |
12 | | - - Upload the file to the $web container |
13 | | - - Create and upload a custom error page |
14 | | - - Verify the live site and error page |
| 12 | +- Create the HTML file locally |
| 13 | +- Upload the file to the $web container |
| 14 | +- Create and upload a custom error page |
| 15 | +- Verify the live site and error page |
15 | 16 |
|
16 | | -**Outcome:** A live public website displaying your Version 1 content. |
17 | | - |
18 | | -## Task 1: Create the HTML file locally |
19 | | - |
20 | | -Create a simple HTML file on your computer that will serve as the initial version of your website. This file represents the content your team wants to publish. |
21 | | - |
22 | | -1. On your local computer, open a text editor (such as Notepad). |
23 | | -2. Paste the following content: |
24 | | - |
25 | | - ```html |
26 | | - <!DOCTYPE html> |
27 | | - <html> |
28 | | - <head><title>Product Landing Page</title></head> |
29 | | - <body> |
30 | | - <h1>Version 1 - Landing Page</h1> |
31 | | - <p>Welcome to our product page. This is the initial published version.</p> |
32 | | - </body> |
33 | | - </html> |
34 | | - ``` |
35 | | - |
36 | | -3. Save the file as **index.html**. |
37 | | - |
38 | | -## Task 2: Upload the file to the $web container |
39 | | - |
40 | | -Upload your HTML file to the special **$web** container that Azure created when you enabled static website hosting. Files in this container are automatically served to visitors who browse to your site endpoint. |
41 | | - |
42 | | -1. In the Azure portal, return to your storage account. |
43 | | -2. In the left menu, under **Data storage**, select **Containers**. |
44 | | -3. Select the **$web** container. |
45 | | -4. Select **Upload**. |
46 | | -5. Select **Browse for files**, select the **index.html** file you created, and upload it. |
47 | | -6. Confirm that **index.html** appears in the container file list. |
48 | | - |
49 | | -## Task 3: Create and upload a custom error page |
50 | | - |
51 | | -Create a custom 404 error page that visitors see when they browse to a page that doesn't exist. Without this file, visitors get a generic XML error, which looks unprofessional. |
52 | | - |
53 | | -1. On your local computer, open a text editor. |
54 | | -2. Paste the following content: |
55 | | - |
56 | | - ```html |
57 | | - <!DOCTYPE html> |
58 | | - <html> |
59 | | - <head><title>Page Not Found</title></head> |
60 | | - <body> |
61 | | - <h1>404 - Page Not Found</h1> |
62 | | - <p>The page you requested does not exist. Return to the <a href="/">home page</a>.</p> |
63 | | - </body> |
64 | | - </html> |
65 | | - ``` |
66 | | - |
67 | | -3. Save the file as **404.html**. |
68 | | -4. In the Azure portal, return to the **$web** container. |
69 | | -5. Select **Upload**, select **Browse for files**, select the **404.html** file, and upload it. |
70 | | -6. Confirm that both **index.html** and **404.html** appear in the container. |
| 17 | +Launch the exercise and follow the instructions. When you're done, be sure to return to this page so you can continue learning. |
71 | 18 |
|
72 | 19 | > [!NOTE] |
73 | | -> **Validation step:** The **$web** container should list both **index.html** and **404.html**. |
| 20 | +> To complete this lab you will need an [Azure subscription](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn). |
74 | 21 |
|
75 | | -## Task 4: Verify the live site and error page |
76 | | - |
77 | | -Open the public endpoint in a browser to confirm your website is live, and then test the custom error page. This validates that static website hosting is correctly configured for both normal pages and missing pages. |
78 | | - |
79 | | -1. In the Azure portal, navigate back to your storage account (use the portal search bar to search for **Storage accounts** and select your account if needed). |
80 | | -2. In the left menu, under **Data management**, select **Static website**. |
81 | | -3. Select the **Primary endpoint** link to open the site in a new browser tab. |
82 | | -3. Confirm the page displays **Version 1 - Landing Page** and the welcome message. |
83 | | -4. In the browser address bar, add **/fakepage** to the end of the URL and press Enter. |
84 | | -5. Confirm the custom 404 page appears with the **Page Not Found** heading and a link back to the home page. |
85 | | -6. Select the **home page** link and confirm it returns to the Version 1 landing page. |
86 | | - |
87 | | -> [!NOTE] |
88 | | -> **Validation step:** The landing page displays **Version 1 - Landing Page**, and browsing to a nonexistent path shows your custom **404 - Page Not Found** page. |
| 22 | +[:::image type="content" source="../media/launch-exercise-button.png" alt-text="Button to launch exercise.":::](https://microsoftlearning.github.io/Deploy-a-static-website-with-Azure-Blob-Storage/Instructions/Labs/3-exercise-upload-verify-content.html) |
0 commit comments