[How To] Configure VPN in AZURE PAAS Project asp.net

Configure Virtual Private Network AZURE

How to confgiure virtual private network (VPN) in azure PAAS
Azure

To connect to a specific network for doing some purposes from your asp.net web application, we need to connect that network via Virtual Private Network (VPN) to the hosted server. In the case of AZURE PAAS project, all must be configured in the ServiceConfiguration.Cloud.cscfg file.

First we need to create Virtual network site and subnet configuration in the AZURE portal. We need that virtual network site name and subnet name for to connect with our AZURE web application.

ServiceConfiguration.Cloud.cscfg Configure


<NetworkConfiguration>
    <VirtualNetworkSite name="TESTVNET" />
    <AddressAssignments>
      <InstanceAddress roleName="WebRoleTest">
        <Subnets>
          <Subnet name="TESTSubNet" />
        </Subnets>
      </InstanceAddress>
      <InstanceAddress roleName="WorkerRoleTest">
        <Subnets>
          <Subnet name="TESTSubnet" />
        </Subnets>
      </InstanceAddress>
    </AddressAssignments>
  </NetworkConfiguration>

In the above configuration, i have created two roles WebRoleTest (web role) and WorkerRoleTest (worker role). We need to configure separate instance configurations for separately created roles, because it will be placed in two different places after deploying. Replace you Virtual network site name and subnet name, also your roles name in the above configuration. If you do have one role you just need the following code.
<NetworkConfiguration>
    <VirtualNetworkSite name="TESTVNET" />
    <AddressAssignments>
      <InstanceAddress roleName="WebRoleTest">
        <Subnets>
          <Subnet name="TESTSubNet" />
        </Subnets>
      </InstanceAddress>
    </AddressAssignments>
  </NetworkConfiguration>

If you do have any doubts, just comment here.
[How To] Configure VPN in AZURE PAAS Project asp.net [How To] Configure VPN in AZURE PAAS Project asp.net Reviewed by Tech Doubts on 9:57 PM Rating: 5

No comments:

Powered by Blogger.