Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Deploy hybrid SQL Server solutions

A worked example

Put in order

Contoso is extending its on-premises SQL Server estate to Azure. An administrator uploaded a custom VHD of an on-premises Windows Server machine that runs SQL Server 2019 and created an Azure virtual machine named VM1 from it in resource group RG1, in a region that the SQL IaaS Agent extension supports.

  • VM1 is running and is not registered with the SQL IaaS Agent extension. Automatic registration has not happened, so you must register VM1 manually.
  • The Microsoft.SqlVirtualMachine resource provider shows NotRegistered for the subscription.
  • Contoso has Software Assurance and must use its existing SQL Server license for VM1.
  • You hold the Contributor role on the subscription and use the latest Azure CLI.
  • Before you close the change request, you must confirm by command output that the registration succeeded.

Which actions should you perform, in order, to register VM1 with the SQL IaaS Agent extension and meet the requirements?

Your order

You didn't answer this one.

Correct order
1Run az provider register --namespace Microsoft.SqlVirtualMachine for the subscription.
2Run az sql vm create --name VM1 --resource-group RG1 --location <VM1 region> --license-type AHUB.
3Run az sql vm show -n VM1 -g RG1 and confirm that ProvisioningState is Succeeded.
Why

Although CEIP detection can automatically register Azure VMs running SQL Server 2016 or later, VM1 has not been registered, so manual registration is required here. The subscription first has to be registered with the Microsoft.SqlVirtualMachine resource provider so the extension can create the SQL virtual machine resource. You then register VM1 with az sql vm create and the AHUB license type to use the existing license. Finally, az sql vm show must report a ProvisioningState of Succeeded to provide the confirmation the scenario requires.

  • Step 1: Run az provider register --namespace Microsoft.SqlVirtualMachine for the subscription. The subscription is not yet registered with the Microsoft.SqlVirtualMachine resource provider, and this registration must come first because it allows the extension to create resources in the subscription.
  • Step 2: Run az sql vm create --name VM1 --resource-group RG1 --location <VM1 region> --license-type AHUB. Registering the VM with the extension creates the SQL virtual machine resource, which needs the resource provider registered in step 1; AHUB applies Contoso's existing license.
  • Step 3: Run az sql vm show -n VM1 -g RG1 and confirm that ProvisioningState is Succeeded. The scenario requires command-output proof of success, and there is no SQL virtual machine resource to show until step 2 has registered VM1.
  • Not needed: In the Azure portal, open VM1 and register it with the SQL IaaS Agent extension. Registering a SQL Server VM with the extension is not currently possible through the Azure portal; it must be done with Azure CLI or Azure PowerShell.
  • Not needed: Run az sql vm create --name VM1 --resource-group RG1 --location <VM1 region> --license-type PAYG. PAYG bills SQL Server per usage, which breaks the requirement to use Contoso's existing license; AHUB is the license type for using your own license.
  • Not needed: Stop and deallocate VM1 before registering it with the extension. A prerequisite for registration is that the Azure VM is running, so stopping VM1 would prevent the registration.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free