Skip to content

Latest commit

 

History

History
107 lines (59 loc) · 5.59 KB

03-access-your-application-in-private-network.md

File metadata and controls

107 lines (59 loc) · 5.59 KB

Access your application in private network

When Assign Endpoint for applications in an Azure Spring Cloud service instance deployed in your own virtual network, the endpoint is a private FQDN which is only accessible in private network, and functionalities uses the application's endpoint, include Test Endpoint described in Verify the staging deployment and Log streaming described in Stream Azure Spring Cloud app logs in real-time, are also only works within the private network.

To access the application endpoint, you need to create an Azure Private DNS Zone in your subscription to translate/resolve the private FQDN to its IP address.

Create a private DNS zone

  1. Open the Azure portal. From the top search box, search for Private DNS zones, and select Private DNS zones from the result.

  2. On the Private DNS zones page, select + Add.

  3. Fill out the form on the Create Private DNS zone page. Please enter private.azuremicroservices.io as the Name of the zone.

  4. Select Review + Create.

  5. Select Create.

It may take a few minutes to create the zone.

Link the virtual network

To link the private DNS zone to the virtual network, you need to create a virtual network link.

  1. Select the private.azuremicroservices.io private DNS zone resource created above.

  2. On the left pane, select Virtual network links.

  3. Select Add.

  4. Type azure-spring-cloud-dns-link for the Link name.

  5. For Virtual network, select the virtual network you created in guidance Deploy Azure Spring Cloud in your Azure virtual network (VNet injection).

  6. Select OK.

Create DNS record

To use the private DNS zone to translate/resolve DNS, you need to create an "A" type record in the zone.

  1. Select the virtual network resource you created in guidance Deploy Azure Spring Cloud in your Azure virtual network (VNet injection).

  2. In the Connected devices search box, enter kubernetes-internal.

  3. In the filtered result, find the one connected to the Service Runtime subnet of the service instance, and copy its IP Address. In this sample, the IP Address is 10.1.0.7.

    Or you can fetch the IP using the following az cli command:

    SPRING_CLOUD_RG= # Resource group name of your Azure Spring Cloud service instance
    SPRING_CLOUD= # Name of your Azure Spring Cloud service instance
    
    SERVICE_RUNTIME_RG=`az spring-cloud show -g $SPRING_CLOUD_RG -n $SPRING_CLOUD --query "properties.networkProfile.serviceRuntimeNetworkResourceGroup" -o tsv`
    
    IP_ADDRESS=`az network lb frontend-ip list --lb-name kubernetes-internal -g $SERVICE_RUNTIME_RG --query "[0].privateIpAddress" -o tsv`
    
  4. Select the private.azuremicroservices.io private DNS zone resource created above.

  5. Select + Record set.

  6. In Add record set, enter or select this information:

    Setting Value
    Name Enter *
    Type Select A
    TTL Enter 1
    TTL unit Select Hours
    IP address Enter the IP address copied in step 3. In the sample, enter 10.1.0.7.

    Then select OK.

Assign private FQDN for your application

After following the guide of Build and deploy microservice applications, you can assign private FQDN for your application.

  1. Select the Azure Spring Cloud service instance deployed in your own virtual network, and open the Apps tab in the menu on the left.

  2. Select the application to show the Overview page.

  3. Select Assign Endpoint to assign a private FQDN to your application. This can take a few minutes.

  4. The assigned private FQDN (labeled URL) is now available. It can only be accessed within the private network, but not on Internet.

Access application private FQDN

After assign, now you can access the private FQDN of your application in private network. For example, you can create a jumpbox machine in the same virtual network, or a peered virtual network, and on that jumpbox machine the private FQDN is accessible.

Next guide ➡️

See also