curl: (7) Failed to connect to 20.245.88.48 port 80 after 1 ms: Couldn't connect to server

koolcreation 60 Reputation points
2023-01-26T16:57:36.37+00:00

Working on Unit 9 of 14 Describe Azure compute and networking services.

I'm following the exercise to configure network access and having trouble on the last steps.

After creating a network security rule that allows inbound access on port 80 (HTTP)

Task 3

Run the following az network nsg rule create command to create a rule called allow-http that allows inbound access on port 80:

Azure CLI

Copy
az network nsg rule create \
  --resource-group learn-4b46baa6-3e14-4a2d-b07f-55e43f890106 \
  --nsg-name my-vmNSG \
  --name allow-http \
  --protocol tcp \
  --priority 100 \
  --destination-port-range 80 \
  --access Allow

After verifying the configuration. I confirmed that Port 80 was allowed.

Name Priority Port Access


default-allow-ssh 1000 22 Allow

allow-http 100 80 Allow

I ran the Curl command as the exercise stated.

"curl --connect-timeout 5 http://$IPADDRESS"

And I keep getting

curl: (7) Failed to connect to 20.245.88.48 port 80 after 1 ms: Couldn't connect to server

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.
847 questions
{count} votes

Accepted answer
  1. kobulloc-MSFT 23,181 Reputation points Microsoft Employee
    2023-01-26T18:13:34.0433333+00:00

    Hello, koolcreation !

    Where am I seeing this?

    Why am I receiving a curl: (7) Failed to connect to xx.xxx.xx.xx port 80 after 1 ms: Couldn't connect to server error?
    If it's been more than an hour since you completed the prerequisite, Unit 3 - Exercise - Create an Azure Virtual Machine, your VM will have been automatically deleted and you'll get an error on Task 1, Step 2. Complete the prerequisite to create a virtual machine in Unit 3, and then complete this unit before an hour is up.

    If you are still running into this issue after completing the prerequisite, post a comment to let us know and we'll continue to troubleshoot this.

    Complete the prerequisite less than an hour before working on this unit so that your VM isn't automatically deleted

    268259-image.png


0 additional answers

Sort by: Most helpful