Issue with Exercise

Derek Armstrong 15 Reputation points
2023-04-26T17:20:30.2966667+00:00

When running through the Microsoft Azure Fundamentals course, I am having an issue on the exercise "Create an Azure Virtual Machine" Task 1 fails on the second bullet. "Run the following az vm extension set command to configure Nginx on your VM"

The VM is there and up, but the install of nginx fails as per the error below:

(VMExtensionProvisioningError) VM has reported a failure when processing extension 'customScript'. Error message: "Enable failed: failed to execute command: command terminated with exit status=1
[stdout]
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [83.3 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2648 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8570 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [455 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [1207 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [167 kB]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1290 kB]
Get:11 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [304 kB]
Get:12 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [19.8 kB]
Get:13 http://security.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [3928 B]
Get:14 http://archive.ubuntu.com/ubuntu bionic/universe Translation-en [4941 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [151 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic/multiverse Translation-en [108 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2967 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [542 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [1237 kB]
Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [172 kB]
Get:21 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1900 kB]
Get:22 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [416 kB]
Get:23 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [25.6 kB]
Get:24 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [6088 B]
Get:25 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [53.3 kB]
Get:26 http://archive.ubuntu.com/ubuntu bionic-backports/main Translation-en [14.6 kB]
Get:27 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [18.1 kB]
Get:28 http://archive.ubuntu.com/ubuntu bionic-backports/universe Translation-en [8668 B]
Fetched 27.5 MB in 1min 2s (445 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/vmextensionlinuxtroubleshoot 
Code: VMExtensionProvisioningError
Message: VM has reported a failure when processing extension 'customScript'. Error message: "Enable failed: failed to execute command: command terminated with exit status=1
[stdout]
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [83.3 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2648 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8570 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [455 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [1207 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [167 kB]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1290 kB]
Get:11 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [304 kB]
Get:12 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [19.8 kB]
Get:13 http://security.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [3928 B]
Get:14 http://archive.ubuntu.com/ubuntu bionic/universe Translation-en [4941 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [151 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic/multiverse Translation-en [108 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2967 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [542 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [1237 kB]
Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [172 kB]
Get:21 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1900 kB]
Get:22 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [416 kB]
Get:23 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [25.6 kB]
Get:24 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [6088 B]
Get:25 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [53.3 kB]
Get:26 http://archive.ubuntu.com/ubuntu bionic-backports/main Translation-en [14.6 kB]
Get:27 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [18.1 kB]
Get:28 http://archive.ubuntu.com/ubuntu bionic-backports/universe Translation-en [8668 B]
Fetched 27.5 MB in 1min 2s (445 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/vmextensionlinuxtroubleshoot 

I am unable to do the next hands on exercise due to this issue. Any help would be greatly appreciated.

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,668 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Derek Armstrong 15 Reputation points
    2023-04-26T17:37:23.4866667+00:00

    Managed to find a work around. I forked the git repository and edited the configure-nginx.sh script to install nginx-core instead. This allowed the exercise to move forward.

    Suggestion is to update the script on the official Github page.

    3 people 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.