How do I connect to a localhost:8888 inside an Azure VM from a browser/curl on HTTP(s) protocol?

Steelman Qaz 0 Reputation points
2023-10-10T01:53:33.76+00:00

How do I connect to a localhost:8888 inside an Azure VM from a browser/curl on HTTP(s) protocol?

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,205 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KapilAnanth-MSFT 37,566 Reputation points Microsoft Employee
    2023-10-12T07:02:48.5+00:00

    Hi @Steelman Qaz

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    I am afraid I did not quite understand your question here.

    Please note that localhost means 127.0.0.1 and which in turn means your local machine.

    In case you would like to access your Azure VM server from a client browser,

    • You should associate a Public IP to the VM
    • and then allow network traffic to the VM via NSG.

    #1 Associate a Public IP to a VM :

    #2 Allow access via NSG :

    • Create a NSG : here
    • Associate this NSG to the NIC/Subnet of the VM : here
    • Create an allow Rule : here
      • Make sure you configure
        Source is Any,
        Destination is Any
        Protocol is Any
        and Destination Port as 8888

    Points to Note:

    • Since the port 8888 is not a common port for HTTP or HTTPS, you must explicitly specify the port from the browser while accessing the site.
    • i.e., it should be "https://<publicIpOfTheVM>:8888"

    Hope this helps.

    Cheers,

    Kapil

    1 person found this answer helpful.
    0 comments No comments