Share via

Configure Network Access Exercise Task 4

Justin Mcgarry 20 Reputation points
2025-02-09T15:45:14.5233333+00:00

I have tried to complete this exercise twice on two separate occasions and have completed the work as detailed, but in the final step, the process keeps failing.

I have 42 minutes remaining on my Sandbox at the time of this question. Here is my output:

justin [ ~ ]$ az network nsg rule create \

--resource-group "learn-2b9202b8-3698-4957-b8f2-d2fe4bde383f" \

--nsg-name my-vmNSG \

--name allow-http \

--protocol tcp \

--priority 100 \

--destination-port-range 80 \

--access Allow

{

"access": "Allow",

"destinationAddressPrefix": "*",

"destinationAddressPrefixes": [],

"destinationPortRange": "80",

"destinationPortRanges": [],

"direction": "Inbound",

"etag": "W/"24b8249a-62fb-4fd7-81bd-8f7037ac9e11"",

"id": "/subscriptions/66934742-a2f4-4f94-ad7b-07a47d83d2bc/resourceGroups/learn-2b9202b8-3698-4957-b8f2-d2fe4bde383f/providers/Microsoft.Network/networkSecurityGroups/my-vmNSG/securityRules/allow-http",

"name": "allow-http",

"priority": 100,

"protocol": "Tcp",

"provisioningState": "Succeeded",

"resourceGroup": "learn-2b9202b8-3698-4957-b8f2-d2fe4bde383f",

"sourceAddressPrefix": "*",

"sourceAddressPrefixes": [],

"sourcePortRange": "*",

"sourcePortRanges": [],

"type": "Microsoft.Network/networkSecurityGroups/securityRules"

}

justin [ ~ ]$ az network nsg rule list \

--resource-group "learn-2b9202b8-3698-4957-b8f2-d2fe4bde383f" \

--nsg-name my-vmNSG \

--query '[].{Name:name, Priority:priority, Port:destinationPortRange, Access:access}' \

--output table

Name Priority Port Access


default-allow-ssh 1000 22 Allow

allow-http 100 80 Allow

justin [ ~ ]$ curl --connect-timeout 5 http://$IPADDRESS

curl: (28) Failed to connect to 13.91.104.221 port 80 after 5002 ms: Timeout was reached

Nothing I do will get this connection to go through.

Azure | Azure Training
0 comments No comments

Answer accepted by question author

TP 157.6K Reputation points Volunteer Moderator
2025-02-09T16:05:37.3833333+00:00

Hi Justin,

When you completed Unit 3 Exercise - Create an Azure virtual machine did NGINX install successfully? NGINX is required so that the curl command will work in Unit 9 Exercise - Configure network access.

I tested last week and was able to complete exercise successfully. Please see screenshots below:

User's image

User's image

Please Activate a new sandbox, complete Unit 3 exercise, then jump to Unit 9 Exercise and complete it.

If you would like to troubleshoot using SSH to the VM, enter below command in your sandbox cloud shell, then enter yes when prompted:

ssh azureuser@$IPADDRESS

See screenshot (I manually entered IP address instead of using $IPADDRESS):User's image

Once you have successfully connected to the VM using SSH, you can run below command to check if NGINX is running:

sudo service nginx status

User's image

Please click Accept Answer and upvote if the above was helpful.

Thanks.

-TP

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

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