Getting Error when configuring Nginx in Azure training lab

Philippe Lefebvre 0 Reputation points
2024-11-07T16:09:34.0233333+00:00

I am doing the exercise part of the Azure Fundamentals certification which consists of creating an Azure VM and then configure Ngnix on the VM. I was able creating the VM, however the Ngnix process always fails after 3 attempts. Here's what I am getting:

(VMExtensionProvisioningError) VM has reported a failure when processing extension 'customScript' (publisher 'Microsoft.Azure.Extensions' and type 'customScript'). Error message: 'Enable failed: failed to execute command: command terminated with exit status=1
[stdout]
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Get:2 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1911 kB]
Hit:3 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [307 kB]
Get:6 http://security.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [13.3 kB]
Get:7 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [2545 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]
Get:9 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [440 kB]
Get:10 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 c-n-f Metadata [580 B]
Get:11 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [913 kB]
Get:12 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [181 kB]
Get:13 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [19.5 kB]
Get:14 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [37.2 kB]
Get:15 http://security.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [7588 B]
Get:16 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [224 B]
Get:17 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [14.1 MB]
Get:18 http://archive.ubuntu.com/ubuntu jammy/universe Translation-en [5652 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy/universe amd64 c-n-f Metadata [286 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [217 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy/multiverse Translation-en [112 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 c-n-f Metadata [8372 B]
Get:23 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2127 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [365 kB]
Get:25 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [17.9 kB]
Get:26 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [2605 kB]
Get:27 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [450 kB]
Get:28 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 c-n-f Metadata [612 B]
Get:29 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1134 kB]
Get:30 http://archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [265 kB]
Get:31 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [26.4 kB]
Get:32 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [43.3 kB]
Get:33 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [10.8 kB]
Get:34 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [440 B]
Get:35 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [67.7 kB]
Get:36 http://archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [11.1 kB]
Get:37 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B]
Get:38 http://archive.ubuntu.com/ubuntu jammy-backports/restricted amd64 c-n-f Metadata [116 B]
Get:39 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [28.8 kB]
Get:40 http://archive.ubuntu.com/ubuntu jammy-backports/universe Translation-en [16.5 kB]
Get:41 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [672 B]
Get:42 http://archive.ubuntu.com/ubuntu jammy-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 34.3 MB in 10s (3340 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
<html><body><h2>Welcome to Azure! My name is my-vm.</h2></body></html>
[stderr]
E: Unable to locate package nginx
tee: /var/www/html/index.html: No such file or directory
'. More information on troubleshooting is available at https://aka.ms/VMExtensionCSELinuxTroubleshoot. 
Code: VMExtensionProvisioningError
Message: VM has reported a failure when processing extension 'customScript' (publisher 'Microsoft.Azure.Extensions' and type 'customScript'). Error message: 'Enable failed: failed to execute command: command terminated with exit status=1
[stdout]
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Get:2 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1911 kB]
Hit:3 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [307 kB]
Get:6 http://security.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [13.3 kB]
Get:7 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [2545 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]
Get:9 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [440 kB]
Get:10 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 c-n-f Metadata [580 B]
Get:11 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [913 kB]
Get:12 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [181 kB]
Get:13 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [19.5 kB]
Get:14 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [37.2 kB]
Get:15 http://security.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [7588 B]
Get:16 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [224 B]
Get:17 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [14.1 MB]
Get:18 http://archive.ubuntu.com/ubuntu jammy/universe Translation-en [5652 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy/universe amd64 c-n-f Metadata [286 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [217 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy/multiverse Translation-en [112 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 c-n-f Metadata [8372 B]
Get:23 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2127 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [365 kB]
Get:25 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [17.9 kB]
Get:26 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [2605 kB]
Get:27 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [450 kB]
Get:28 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 c-n-f Metadata [612 B]
Get:29 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1134 kB]
Get:30 http://archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [265 kB]
Get:31 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [26.4 kB]
Get:32 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [43.3 kB]
Get:33 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [10.8 kB]
Get:34 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [440 B]
Get:35 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [67.7 kB]
Get:36 http://archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [11.1 kB]
Get:37 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B]
Get:38 http://archive.ubuntu.com/ubuntu jammy-backports/restricted amd64 c-n-f Metadata [116 B]
Get:39 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [28.8 kB]
Get:40 http://archive.ubuntu.com/ubuntu jammy-backports/universe Translation-en [16.5 kB]
Get:41 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [672 B]
Get:42 http://archive.ubuntu.com/ubuntu jammy-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 34.3 MB in 10s (3340 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
<html><body><h2>Welcome to Azure! My name is my-vm.</h2></body></html>
[stderr]
E: Unable to locate package nginx
tee: /var/www/html/index.html: No such file or directory
'. More information on troubleshooting is available at https://aka.ms/VMExtensionCSELinuxTroubleshoot. 

I need help in order to complete the subsequent labs.

Thx

This question is related to the following Learning Module

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,831 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shruthi Thalari 170 Reputation points Microsoft Vendor
    2024-11-07T18:07:30.3266667+00:00

    Hi @Philippe Lefebvre
    Thank you for reaching out to us on MS Q&A forum.

    We regret any inconvenience this may have caused. Based on my understanding of the situation, it seems you are working on the following Learning Path exercise:

    Topic: AZ-900

    Learning Path: Azure Fundamentals: Describe Azure architecture and services

    Module: Describe Azure compute and networking services

    Unit: 3 of 14 Exercise - Create an Azure Virtual Machine

    I've made multiple attempts to reproduce the issue, and I can confirm that the documented steps function correctly for me.

    Please review a related discussion thread (authored by TP) for summarized steps.

    Here's a brief rundown of the steps:

    1. Activate a new sandbox and create the VM as indicated in the Exercise (Step 1 under "Create a Linux VM and Install Nginx").
    2. After completing Step 1, take note of the Public IP address assigned to the VM.
    3. Prior to proceeding to Step 2, establish a connection to the newly created VM using the SSH command in the cloud shell. Execute the following command to connect to the VM: ssh azureuser@<VM public ip address>. When prompted, respond with "Yes."
    4. Execute the following commands sequentially within the cloud shell:
    • sudo apt-get update
    • sudo apt-get install -y nginx
    • echo "<html><body><h2>Welcome to Azure! My name is $(hostname).</h2></body></html>" | sudo tee -a /var/www/html/index.html
    • exit

    Upon completing Step 4, continue your module starting from Step 2 of Task 1: "Create a Linux Virtual Machine and Install Nginx," within Module 3 of 14.

    If the issue continues to persist, please do not hesitate to inform us, and we will be more than happy to provide further assistance.

    If you have found the answer provided to be helpful, please click on the "Accept Answer and Upvote" button so that it is useful for other members in the Microsoft Q&A community.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.