Disconnect an Azure VM from Internet - azure

I have to test the behavior of a SharePoint migration tool installed on my Azure VM when Internet connection is lost.
I access to this VM by RDP.
How can I cut off Internet connection of my VM and restore it later ?
Thanks in advance.

I second the suggestions posted by 4c74356b41, you could also disable the Network Adapter and then reset the Network adapter to restore the connection. If you wish to take this approach checkout these steps:
For VMs deployed in Resource group model
Go to the Azure portal.
Select the affected Virtual Machine.
Select Network Interfaces.
Select the Network Interface associated with your machine
Select IP configurations.
Select the IP.
If the Private IP assignment is not Static, change it to Static.
Change the IP address to another IP address that is available in the Subnet.
The virtual machine will restart to initialize the new NIC to the system.
Try to RDP to your machine. If successful, you can change the Private IP address back to the original if you would like. Otherwise, you can keep it.
Delete the unavailable NICs
After you can remote desktop to the machine, you must delete the old NICs to avoid the potential problem:
Open Device Manager.
Select View > Show hidden devices.
Select Network Adapters.
Check for the adapters named as "Microsoft Hyper-V Network Adapter".
You might see an unavailable adapter that is grayed out. Right-click the adapter and then select Uninstall.
Ref: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/reset-network-interface

Create a deny internet outgoing rule on the network security group and attach it to the VM network adapter.
https://blogs.msdn.microsoft.com/igorpag/2016/05/14/azure-network-security-groups-nsg-best-practices-and-lessons-learned/
You may have to create allow rules for Azure storage for outbound traffic for VM agent to work.

Related

Azure Point-to-Site : RDP

I configured a P2S VPN and was able to access the Jump-box in the Hub Virtual Network via a private IP address.
Using the same P2S VPN, I cannot reach the VM in the Production subscription while I could RDP into the VM from the Jumb-box directly.
RDP is allowed at the NSG level
RDP is allowed at the firewall level
Hub-to-Spoke Peering is done
Spoke-to-hub Peering is done
10.0.0.68 is the firewall IP
Routing table is configured as shown below
and
I feel that this is more of a Firewall / Route Table issue
I tried to reproduce the same issue in my environment and got the below results
Remote desktop has the feature to connect the other computers to resolve the issue find the below steps
Change the firewall settings
Click on Windows button and search "allow-app through windows firewall" and changed the settings as mentioned in the screenshot
2). Allow the remote desktop connection
Click the windows button and search for "allow remote desktop connection"
3). Adding the RDGCLIENT transport key
Press windows + R and type regedit and enter
4). Changing the network properties
press windows + I and network and properties and change the network status is to Private
Note: If all the settings to be properly connected and if still not able to connect, for particular subscription we may have the restrictions to connect the RDP, Contact the admin department

Unable to access virtual machine via internet

I have created classic Virtual Machine on Azure.Machine has created and deployed successfully and i got URL (abc.cloudapp.net). I am trying to access from internet but could not connected.I am able to login via remotely.
You first have to make sure you have a Web server such as IIS running there on the VM. Then make sure the firewall in the OS allows traffic to port 80.
If you have a classic VM, you have to add a rule in the endpoint's ACL.
If you have a Resource Manager VM, add an exception to Network Security Group's inbound security rules.
You can find the Network Security Group by finding the Network Interface Card attached to your VM. By default it is attached there.
As Juunas says, we should add the endpoint with Azure portal.
1.sign in to the Azure classic portal.
2.Click Virtual Machines, and then click the name of the virtual machine that you want to configure.
3.Click Endpoints. The Endpoints page lists all the current endpoints for the virtual machine. (This example is a Windows VM. A Linux VM will by default show an endpoint for SSH.)
4.In the taskbar, click Add.
5.On the Add an endpoint to a virtual machine page, choose the type of endpoint. And type the port number for the incoming traffic form the internet, in private Port, type the port number on which the virtual machine is listening.
More information about add an endpoint, please refer to the link below:
https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-classic-setup-endpoints/
If you still have questions, welcome to post back here. Thanks.
Best Regards,

Azure VM Remote Desktop Can't Connect

Following a how-to book's guide on setting up a VM through the Azure Portal and getting the error when trying to connect
Remote Desktop can't connect to the remote computer for one of these reasons: 1) Remote access to the service is not enabled 2) The remote computer is turned off [Verified through the Azure Portal it is turned on because Start is faded, while Restart and Stop are not] 3) The remote computer is not available on the network.
The error occurs before I'm able to enter any credentials - it doesn't find the IP at all. The RDP file details (IP removed of course):
full address:s:[IPAddress]:3389
prompt for credentials:i:1
administrative session:i:1
What I've tried:
Even though the How-To book doesn't show where/how to specify a port, when I download the RDP file from the Connect option, it specifies the port 3389. The book seems to imply that simply downloading this file and connecting will work and there's no need to specify the port. I get the above error.
Flushed DNS on my computer, ipconfig /flushdns
In the Network Security Group option for the VM, I verified that port 3389 allowed any source and wasn't specific.
I did miss associating the subnet part of the Network Security Group to a virtual network, so I did associate my NSG with the default subnet set up for my Virtual Network.
From the Quick start option, I don't see how to connect to this either; I'm guessing, I need to specify a different port, but don't see where to do it here either => Update: this appears to be in the Network Security Group's Inbound security rules in the Azure portal.
Boot Diagnostics option shows the login screen. A ping to the IP address fails four times with "Request timed out."
Note: this is not a Virtual Machine (classic).
just wanted to share what worked for me.
After receiving an error prompt:
Connect is disabled for this virtual machine because of the following
issues: Network interface 'vmwindows1094': Network security group
'VMWindows10-nsg' does not have inbound security rule that allows port
3389. VMWindows10-nsg
I have added an inbound port rule. Under VM > Settings > Add inbound port rules.
Port: 3389 Protocol/Source/Destination: Any (this can be configured based on your security rules) Action: Allow
On the Azure portal, Select your VM -> Settings -> Boot diagnostics. Make sure that you can see the login screen. You might need to enable diagnostics (under Monitoring section) if not enabled already.
If you don't see the login screen, trying the 'Redeploy' option under 'Support and Troubleshooting' section of settings.
If you can see that the machines has booted correctly, the connectivity issue might be because of a firewall at your end or on the VM. See if you can ping the machine. If you are behind a corporate firewall, try connecting from elsewhere and check your PC's firewall.
Creating a new Virtual Machine on the new portal now creates a NSG (Network Security Group) along with the VM. You should be able to find it under all resources, same name as you VM. Make sure that there is an Inbound rule configured for Remote desktop (it is created by default but might be worth checking).
I had the same problem but adding an inbound security rule was not sufficient (although it is also needed).
I had to go to virtual machines > (myVm) > Reset password and then choose Reset configuration only
Try checking your VM has enough memory.
I had tried all of above suggestions and still didn't manage to access.
After trying many times I managed to get in a message appeared saying:
Your Computer is low on memory
Not 100% sure that was the reason though.
I faced the same issue. I had created an Azure VM but wasn't able to connect to it using RDP.
The culprit was a default "Inbound Port Rule" due to which all the inbound traffic was being blocked.
The solution is to create a new rule by clicking the "Add Inbound Port Rule" and allow traffic from port 3389. Make sure that the priority of this new rule is greater than the "DenyAllInBound" rule otherwise our new rule will not have any effect.
After adding the rule, try connecting to the VM using its public IP in RDP and you should be able to connect.
This worked for me, hope it helps you as well.

Azure virtual network : unable to delete

I have created a couple of Virtual Networks on my Azure account. All of them have point-to-site connectivity enabled. But I dont have any connections actively connected to the network. When I go to the "configure" page for eahc of these networks in the management portal, I see a message sayingthe network is in use and I am unable to delete these networks.
Why does this happen? How can I delete these networks?
Apparently you also have created Gateways for these networks. You have to delete the gateway for the network first, before you are able to delete the network.
This particular part of online documentation describes how to delete a Virtual Network Gateway.
The gateway and the virtual machines attached to the availability set. When you delete the virtual machine but don't delete the disk, you can restore it again.

Azure VMs Virtual Network inter-communication

I'm new to Azure (strike 1) and totally suck at networking (strike 2).
Nevertheless, I've got two VMs up and running in the same virtual network; one will act as a web server and the other will act as a SQL database server.
While I can see that their internal IP addresses are both in the same network I'm unable to verify that the machines can communicate with each other and am sort of confused regarding the appropriate place to address this.
Microsoft's own documentation says
All virtual machines that you create in Windows Azure can
automatically communicate using a private network channel with other
virtual machines in the same cloud service or virtual network.
However, you need to add an endpoint to a machine for other resources
on the Internet or other virtual networks to communicate with it. You
can associate specific ports and a protocol to endpoints. Resources
can connect to an endpoint by using a protocol of TCP or UDP. The TCP
protocol includes HTTP and HTTPS communication.
So why can't the machines at least ping each other via internal IPs? Is it Windows Firewall getting in the way? I'm starting to wonder if I've chose the wrong approach for a simple web server/database server setup. Please forgive my ignorance. Any help would be greatly appreciated.
If both the machines are in the same Virtual Network, then just turn off Windows Firewall and they will be able to ping each other. Other way is to just allow all incoming ICMP traffic in Windows Firewall with Advanced Settings.
However there is a trick. Both the machines will see each other by IP Addresses, but there will be no name resolution in so defined Virtual Network. Meaning that you won't be able to ping by name, but only by direct IP address. So, if want your Website (on VM1) to connect to SQL Server (on VM2), you have to address it by full IP Address, not machine name.
The only way to make name resolution within a Virtual Network is to use a dedicated DNS server, which you maintain and configure on-premises.
This article describes in details name resolution scenarios in Windows Azure. Your particular case is this:
Name resolution between virtual machines and role instances located in
the same virtual network, but different cloud services
You could potentially achieve name resolution, if you put your VMs is same cloud service. Thus you will not even require dedicated virtual network.
If your VMs are inside a Virtual Network in Azure, then you have to make sure two things.
Required Port is enabled.
Firewall is disabled on the server.
I was trying to connect to one VM where SQL Server DB was installed, from another VM. I Had to enable 1433 port in the VM where SQL was installed. For this you need to add an MSSQL endpoint to the VM on the azure management portal. After that i disabled windows firewall. Then i was able to connect to the VM from another.

Resources