Skip to main content

sql_virtual_machines

Creates, updates, deletes, gets or lists a sql_virtual_machines resource.

Overview

Namesql_virtual_machines
TypeResource
Idazure.sql_vm.sql_virtual_machines

Fields

NameDatatypeDescription
identityobjectAzure Active Directory identity configuration for a resource.
locationstringResource location.
propertiesobjectThe SQL virtual machine properties.
systemDataobjectMetadata pertaining to creation and last modification of the resource.
tagsobjectResource tags.

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, sqlVirtualMachineName, subscriptionIdGets a SQL virtual machine.
listSELECTsubscriptionIdGets all SQL virtual machines in a subscription.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdGets all SQL virtual machines in a resource group.
list_by_sql_vm_groupSELECTresourceGroupName, sqlVirtualMachineGroupName, subscriptionIdGets the list of sql virtual machines in a SQL virtual machine group.
create_or_updateINSERTresourceGroupName, sqlVirtualMachineName, subscriptionId, data__locationCreates or updates a SQL virtual machine.
deleteDELETEresourceGroupName, sqlVirtualMachineName, subscriptionIdDeletes a SQL virtual machine.
updateUPDATEresourceGroupName, sqlVirtualMachineName, subscriptionIdUpdates SQL virtual machine tags.
fetch_dc_assessmentEXECresourceGroupName, sqlVirtualMachineName, subscriptionIdStarts SQL best practices Assessment with Disk Config rules on SQL virtual machine
redeployEXECresourceGroupName, sqlVirtualMachineName, subscriptionIdUninstalls and reinstalls the SQL IaaS Extension.
start_assessmentEXECresourceGroupName, sqlVirtualMachineName, subscriptionIdStarts SQL best practices Assessment on SQL virtual machine.

SELECT examples

Gets all SQL virtual machines in a subscription.

SELECT
identity,
location,
properties,
systemData,
tags
FROM azure.sql_vm.sql_virtual_machines
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new sql_virtual_machines resource.

/*+ create */
INSERT INTO azure.sql_vm.sql_virtual_machines (
resourceGroupName,
sqlVirtualMachineName,
subscriptionId,
data__location,
location,
tags,
identity,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ sqlVirtualMachineName }}',
'{{ subscriptionId }}',
'{{ data__location }}',
'{{ location }}',
'{{ tags }}',
'{{ identity }}',
'{{ properties }}'
;

UPDATE example

Updates a sql_virtual_machines resource.

/*+ update */
UPDATE azure.sql_vm.sql_virtual_machines
SET
tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND sqlVirtualMachineName = '{{ sqlVirtualMachineName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified sql_virtual_machines resource.

/*+ delete */
DELETE FROM azure.sql_vm.sql_virtual_machines
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND sqlVirtualMachineName = '{{ sqlVirtualMachineName }}'
AND subscriptionId = '{{ subscriptionId }}';