Setting up private access to my jenkins server using vpn - azure

I have windows 10 VM in azure cloud and a localhost Jenkins server hosted in my PC!
The question is how can I access the Jenkins server from the VM using VPN .
I googled this issue but I can't find a solution !

You have a local Jenkins server, and you are RDPing into an Azure VM, and then want to access the local Jenkins server from the VM?
If this is the case, you will need network connectivity from your Azure VM to your local computer. To do this, you will have 2 options:
open up your local jenkins server to the internet (not advised for security reasons) by forwarding the port on your local router.
Create a VPN (P2S or S2S) to your Azure VNET on your local computer. Then you should be able to connect from the VM to your internal IP.
The RDP connection will not give any access from your VM back to your computer, so a better way to think about this is just how you can access the site on your local computer from your VM.

Related

Connect from Azure Windows VM (Windows Server 2012) to VPN using built-in VPN client

I am trying to connect to a VPN from a Windows VM on Azure and cannot do so. I am using the built-in Windows VPN Client.
I am connecting to this VPN in order to be able to access a server within that VPN and send and receive HTTP Requests.
I have been able to connect to this VPN normally on other devices using the built-in Windows VPN Client. I followed the exact same steps for the VM but receive the following error when trying to connect:
Error 800:The remote connection was not made because the attempted VPN tunnels failed. The VPN server might be unreachable. If this connection is attempting to use an L2TP/IPsec tunnel, the security parameters required for IPsec negotiation might not be configured properly
Error
I have also opened ports 1723,1701,500,47,4500 in Azure portal for both inbound and outbound on the Azure Portal (screenshot
here)
I have also tried the steps described in this post:
Make a VPN Connection from Azure VM
But does not do what I want. I have the VPN's public IP and username/password, and nowhere does the above mention how to set this up.
Do I need any additional settings or open any other ports in order for this to work?
From your comment, it seems that you want to connect Azure VM to a server on your on-premise network with your local VPN device.
In this case, you could set up a site-to-site VPN connection to connect the Azure VNet and on-premise network following this tutorial: https://learn.microsoft.com/en-us/azure/vpn-gateway/tutorial-site-to-site-portal
After that, you can directly connect to your Azure VM with its private IP address from your on-premise server. In fact, you don't need to connect from Azure Windows VM (Windows Server 2012) to VPN using a built-in VPN client because once the VPN is connected, the traffic from the on-premise network to the Azure network goes through the VPN tunnel and vice versa. We don't need to connect from Azure VM just from on-premise resources.

Connect with RDP download file Error: access Remote Desktop can't connect to the remote computer for one of these reasons

Going through exercises of Fundamentals of Azure, we(me and my team) are unable to connect via our Windows 10 desktops to RDP 3389.
Attached screen-shot.
Test connections outbound of RDP on the portal work as expected. Connection is successful.
But via clicking "Connect" from the dowloaded RDP file we get this error.
There is section to setup Linux VM via windows; currently exploring that but we see little hope.
There can be various reasons that RDP to Azure VM can fail.
Please check Troubleshoot Remote Desktop connections to an Azure virtual machine section if this helps.
If you just created a new VM in Azure it might be a firewall restriction that is causing the error. You can check if the RDP port 3389 be allowed from your client IP address in the network security group.

Connect to Azure SQL Server from computer with dynamic external IP

I am trying to connect an on-premises laptop with dynamic external IP to our Azure SQL Server. To do this, I created a virtual network gateway and connected the laptop to the gateway. Also, I added a private endpoint to the SQL server. After this, I can successfully connect to the SQL server IP using telnet, and if I resolve the SQL server FQDS in hosts file, I can connect to the server via SSMS. But without hosts file, the laptop always tries to connect to the SQL server via its public endpoint/address.
I found the following article: https://techcommunity.microsoft.com/t5/azure-database-support-blog/azure-sql-db-private-link-private-endpoint-connectivity/ba-p/1235573 The article is great. It recommends using your own DNS server to resolve the SQL server FQDN to the local IP. Unfortunately, the laptop does not have access to any custom DNS, so this solution does not suit.
There are two questions:
Is there any possibility to establish connection between an on-premises computer with dynamic IP and an Azure SQL server using a private endpoint but without own DNS server?
If the answer to the first question is "No", is there another way to connect an on-premises computer with dynamic IP to an Azure SQL server using any other Azure application(s)?
First of all, you can not use FQDN without DNS service. So you indeed need a custom DNS server in using FQDN of the server in connection strings for your clients to connect from on-premise VM to the Azure SQL server.
Since you are using a laptop, the DNS servers used by your computer are most likely specified by your ISP. You have no more control over it or ask your ISP to configure the DNS forwarder. Otherwise, you need to deploy a DNS server in your internal network. Currently, in this scenario, the best method is to use the HOSTS file on the local machine to override the Public DNS.
However, if you don't like using the HOSTS file, you can provision an Azure VM as the DNS server in the same Azure virtual network as the virtual network gateway.
Main steps:
Deploy an Azure VM, and RDP to that VM and run the PowerShell commands to install the DNS server role.
Install-WindowsFeature -Name DNS -IncludeManagementTools
Get-WindowsFeature *DNS*
Add Azure DNS (168.63.129.16) as a forwarder on your custom DNS server according to the step 5 in this blog. If you do not want to use forwarder you can also create a forward lookup zone and added manually the host to match the FQDN. You could read On-premises workloads using a DNS forwarder for more details.
After you have configured the DNS server and set the DNS forwarder. You could change the DNS server of Azure VNet to your Azure VM's private IP address.
Restart your Azure VM and re-download the VPN client package and re-connect the VPN connection to make the networking update. Check the DNS server on the local VPN client machine and set the DNS server to the custom DNS server in the TCP/IP settings. Then you will look up your private IP address via the default FQDN of Azure service.
In my example, I am using Azure storage account but it works the same with Azure
SQL database when using a private endpoint on the Azure and P2S VPN connection.
In this way, it requires that there are not any other VPN connections except the
P2S VPN connection on the local machine.
Then you could resolve the Azure SQL server FQDN to the private IP address of the private endpoint. However, it perhaps does not have a better performance to connect to Azure SQL Server with a VPN connection than directly connect to it through the public Internet and public DNS sevice.

Notable to access application outside the Azure remote desktop

I have created virtual machine in Azure cloud and connected to it using remote desktop, installed IIS in it and copy pasted XAP file from my desktop to remote and configured in IIS, i can able to browse application in remote but it cannot be accessed in my local desktop or out of remote, any ideas would be appreciated..
Tnx..
Remote Desktop cannot route network traffic to your VM.
In your case I would suggest you to use a Point-to-Site (P2S) connection to access your website.
For that reason you have to create a virtual network in Azure, deploy your VM into that virtual network and use P2S to connect to your virtual network via VPN. After that you can access your VM's webserver from your local computer.
Here you find a step-by-step guide how to do this: https://azure.microsoft.com/en-us/documentation/articles/vpn-gateway-point-to-site-create/
By the way, you cannot move an existing VM into a virtual network. But there is a very easy workaround. Delete your VM, but DO NOT delete the associated disks or VHDs. Then create a new VM and select in the creation wizard to use an existing disk. There you select the disk from your just deleted VM.

Azure WebSites using new Virtual Network Integration features failed to connect to SQL Server in VM machine

I tried to configure a VPN with default values (10.0.1.x) with a point-to-site feature configured.
Azure Websites has been configured too, using the new Azure portal, to point to the Point-to-Site of the VPN.
When a try to contact SQL server of my VM in Azure (Iaas) fails, while locally on the VM I can do it.
I also configured an end point for the port 1433 on the VM with the relative firewall configuration.
Is there a way to check where is the issue using the website ?
Thanks a lot.
Fabio

Resources