locked
Cannot RDP to freshly provisioned WinServer 2019 VM RRS feed

  • Question

  • I have created and deleted 3 virtual machines.

    Just a simple basic server 2019 instance. This is the template:

    {
        "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
            "location": {
                "type": "string"
            },
            "networkInterfaceName": {
                "type": "string"
            },
            "networkSecurityGroupName": {
                "type": "string"
            },
            "networkSecurityGroupRules": {
                "type": "array"
            },
            "subnetName": {
                "type": "string"
            },
            "virtualNetworkName": {
                "type": "string"
            },
            "addressPrefixes": {
                "type": "array"
            },
            "subnets": {
                "type": "array"
            },
            "publicIpAddressName": {
                "type": "string"
            },
            "publicIpAddressType": {
                "type": "string"
            },
            "publicIpAddressSku": {
                "type": "string"
            },
            "virtualMachineName": {
                "type": "string"
            },
            "virtualMachineRG": {
                "type": "string"
            },
            "osDiskType": {
                "type": "string"
            },
            "virtualMachineSize": {
                "type": "string"
            },
            "adminUsername": {
                "type": "string"
            },
            "adminPassword": {
                "type": "secureString"
            },
            "diagnosticsStorageAccountName": {
                "type": "string"
            },
            "diagnosticsStorageAccountId": {
                "type": "string"
            },
            "diagnosticsStorageAccountType": {
                "type": "string"
            },
            "diagnosticsStorageAccountKind": {
                "type": "string"
            }
        },
        "variables": {
            "nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]",
            "vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
            "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]"
        },
        "resources": [
            {
                "name": "[parameters('networkInterfaceName')]",
                "type": "Microsoft.Network/networkInterfaces",
                "apiVersion": "2019-07-01",
                "location": "[parameters('location')]",
                "dependsOn": [
                    "[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]",
                    "[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
                    "[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]"
                ],
                "properties": {
                    "ipConfigurations": [
                        {
                            "name": "ipconfig1",
                            "properties": {
                                "subnet": {
                                    "id": "[variables('subnetRef')]"
                                },
                                "privateIPAllocationMethod": "Dynamic",
                                "publicIpAddress": {
                                    "id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]"
                                }
                            }
                        }
                    ],
                    "networkSecurityGroup": {
                        "id": "[variables('nsgId')]"
                    }
                }
            },
            {
                "name": "[parameters('networkSecurityGroupName')]",
                "type": "Microsoft.Network/networkSecurityGroups",
                "apiVersion": "2019-02-01",
                "location": "[parameters('location')]",
                "properties": {
                    "securityRules": "[parameters('networkSecurityGroupRules')]"
                }
            },
            {
                "name": "[parameters('virtualNetworkName')]",
                "type": "Microsoft.Network/virtualNetworks",
                "apiVersion": "2019-04-01",
                "location": "[parameters('location')]",
                "properties": {
                    "addressSpace": {
                        "addressPrefixes": "[parameters('addressPrefixes')]"
                    },
                    "subnets": "[parameters('subnets')]"
                }
            },
            {
                "name": "[parameters('publicIpAddressName')]",
                "type": "Microsoft.Network/publicIpAddresses",
                "apiVersion": "2019-02-01",
                "location": "[parameters('location')]",
                "properties": {
                    "publicIpAllocationMethod": "[parameters('publicIpAddressType')]"
                },
                "sku": {
                    "name": "[parameters('publicIpAddressSku')]"
                }
            },
            {
                "name": "[parameters('virtualMachineName')]",
                "type": "Microsoft.Compute/virtualMachines",
                "apiVersion": "2019-07-01",
                "location": "[parameters('location')]",
                "dependsOn": [
                    "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]",
                    "[concat('Microsoft.Storage/storageAccounts/', parameters('diagnosticsStorageAccountName'))]"
                ],
                "properties": {
                    "hardwareProfile": {
                        "vmSize": "[parameters('virtualMachineSize')]"
                    },
                    "storageProfile": {
                        "osDisk": {
                            "createOption": "fromImage",
                            "managedDisk": {
                                "storageAccountType": "[parameters('osDiskType')]"
                            }
                        },
                        "imageReference": {
                            "publisher": "MicrosoftWindowsServer",
                            "offer": "WindowsServer",
                            "sku": "2019-Datacenter",
                            "version": "latest"
                        }
                    },
                    "networkProfile": {
                        "networkInterfaces": [
                            {
                                "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]"
                            }
                        ]
                    },
                    "osProfile": {
                        "computerName": "[parameters('virtualMachineName')]",
                        "adminUsername": "[parameters('adminUsername')]",
                        "adminPassword": "[parameters('adminPassword')]",
                        "windowsConfiguration": {
                            "enableAutomaticUpdates": true,
                            "provisionVmAgent": true
                        }
                    },
                    "licenseType": "Windows_Server",
                    "diagnosticsProfile": {
                        "bootDiagnostics": {
                            "enabled": true,
                            "storageUri": "[concat('https://', parameters('diagnosticsStorageAccountName'), '.blob.core.windows.net/')]"
                        }
                    }
                }
            },
            {
                "name": "[parameters('diagnosticsStorageAccountName')]",
                "type": "Microsoft.Storage/storageAccounts",
                "apiVersion": "2019-06-01",
                "location": "[parameters('location')]",
                "properties": {},
                "kind": "[parameters('diagnosticsStorageAccountKind')]",
                "sku": {
                    "name": "[parameters('diagnosticsStorageAccountType')]"
                }
            }
        ],
        "outputs": {
            "adminUsername": {
                "type": "string",
                "value": "[parameters('adminUsername')]"
            }
        }
    }

    The firewall is open for TCP/3389. 

    I have created a few of these without any issues. 

    I can't understand what the problem could be. Must be a problem with Azure?

    Anyone can confirm?

    Wednesday, November 13, 2019 2:28 PM

All replies

  • Hi, 

    What is the error that you are getting while RDP to the VM?

    Are you RDP via Private IP or Public IP?

    If you are trying to RDP via Public IP, then is your NSG has an allow rule for port 3389?

    Regards, 

    Msrini

    Wednesday, November 13, 2019 3:01 PM
  • Following what msrini proposes you can also check the links below.


    Please, If you think your question has been answered click "Mark as Answer" if just helped click "Vote as helpful". This can be beneficial to other community members reading this forum thread.

    Wednesday, November 13, 2019 3:14 PM
  • Hello,

    Any update on the issue?

    If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" on the answer that helped you for benefit of community.


    Thanks.

    Tuesday, November 19, 2019 11:43 AM
  • Hello,

    Any update on the issue?

    If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" on the answer that helped you for benefit of community.


    Thanks.

    Tuesday, November 26, 2019 10:34 AM
  • Hello,

    Any update on the issue?

    Thanks.
    Friday, November 29, 2019 10:10 AM