Cant connect to my SQL VM

Kamal Nassiri 1 Reputation point
2022-08-21T22:33:26.05+00:00

hi guys,

i cant connect to my SQL SERVER instance on my VM. Dont know whats wrong because everything seems okay. However the Iaas Agency sql extension isnt working either..

some errors:

The SQL virtual machine resource is not in a valid state for management. The cause could be the SQL virtual machine is in bad states, the underlying virtual machine state is invalid (Example: stopped, deallocated or failed) or the virtual machine was not found. Please make sure the SQL virtual machine and the underlying virtual machine are healthy.

Status is available.

[
{
"code": "ComponentStatus/SQL Server IaaS Agent/failed/56061",
"level": "Error",
"displayStatus": "Provisioning failed",
"message": "PreReq failure: ErrorCode: NotRetryableUnexpectedError, Message: Service with name 'MSSQLSERVER' does not exist or is not running. Please make sure service 'MSSQLSERVER' is running and retry this operation."
},
{
"code": "ComponentStatus/SQL Instance Report/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded",
"message": "{\"TargetedSqlInstanceName\":null,\"IsTargetedSqlInstanceInstalled\":false,\"SuggestedSqlInstanceName\":\"MSSQLSERVER\"}"
}
]

I cant even do: Support + troubleshooting>repair (left pane).

Im helpless because i want to create a sql server instance on a VM... (Its image = SQL SERVER 2022 FREE edition)

Could somebody help me please?

SQL Server on Azure Virtual Machines
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,033 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ronen Ariely 15,206 Reputation points
    2022-08-22T02:33:58.663+00:00

    Hi,

    If you do not need your current VM, then your best option is probably to create a new one following these steps

    (1) Go to list of VM: https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Compute%2FVirtualMachines/

    (2) Click on Create and select the first option

    233219-image.png

    (3) fill the form

    In the "image" field, click on the current selection and write: SQL Server

    233324-image.png

    Select the option: Free SQL Server License: SQL 2019 Developer on Windows Server 2019 - Gen1

    Continue to fill all the form

    (4) When you scroll down do not forget to check the: Select inbound ports

    233288-image.png

    Make sure that RDP (remote connection in order to manage the server) is marked

    233238-image.png

    Note: If you own Windows licenses with active Software Assurance (SA) or have an active Windows Server subscription, use Azure Hybrid Benefit to save compute cost.

    (5) Click next until you get to the SQL Server settings tab. Fill all the information in previous tab (probably you can use the default)

    (6) In the SQL Server settings tab make sure that SQL Server settings is set to Public (Internet) or you will not be able to connect the server from outside the Azure!

    233326-image.png

    This was the most important step if you need to connect the SQL Server in the VM from remote!

    This is probably what you missed to configure last time.

    Select port: 1433

    (7) Make sure to enable SQL Authentication

    233351-image.png

    (8) Continue to fill the form (you can configure the SQL instance settings if you want or use the default)

    (9) Click next until you get to the Review + create

    It should look something like this:

    233300-image.png

    You need to open the firewall for connections to use both RDP (remote connection in order to manage the server) and SQL Server (port 1433)


  2. Kamal Nassiri 1 Reputation point
    2022-08-24T21:15:53.253+00:00

    234606-deployment.txthi Pituach,

    I followed every step just as you mentioned however i get an error when my VM is being deployed in my resource group:

    Deployment overview page:

    Resource: UdemyCourseonP
    Type: Microsoft.SqlVirtualMachine/SqlVirtualMachines
    Status: Conflict

    Operation details:
    {
    "status": "Failed",
    "error": {
    "code": "Ext_SqlIaasExtensionError",
    "message": "Error: 'Service with name 'MSSQLSERVER' does not exist or is not running. Please make sure service 'MSSQLSERVER' is running and retry this operation.\r\n\r\nMore information on troubleshooting is available at https://aka.ms/vmextensionwindowstroubleshoot '"
    }
    }

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.