Skip to main content

virtual_network_rules

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

Overview

Namevirtual_network_rules
TypeResource
Idazure.sql.virtual_network_rules

Fields

NameDatatypeDescription
ignore_missing_vnet_service_endpointtextfield from the properties object
resourceGroupNametextfield from the properties object
serverNametextfield from the properties object
statetextfield from the properties object
subscriptionIdtextfield from the properties object
virtualNetworkRuleNametextfield from the properties object
virtual_network_subnet_idtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, serverName, subscriptionId, virtualNetworkRuleNameGets a virtual network rule.
list_by_serverSELECTresourceGroupName, serverName, subscriptionIdGets a list of virtual network rules in a server.
create_or_updateINSERTresourceGroupName, serverName, subscriptionId, virtualNetworkRuleNameCreates or updates an existing virtual network rule.
deleteDELETEresourceGroupName, serverName, subscriptionId, virtualNetworkRuleNameDeletes the virtual network rule with the given name.

SELECT examples

Gets a list of virtual network rules in a server.

SELECT
ignore_missing_vnet_service_endpoint,
resourceGroupName,
serverName,
state,
subscriptionId,
virtualNetworkRuleName,
virtual_network_subnet_id
FROM azure.sql.vw_virtual_network_rules
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.sql.virtual_network_rules (
resourceGroupName,
serverName,
subscriptionId,
virtualNetworkRuleName,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ virtualNetworkRuleName }}',
'{{ properties }}'
;

DELETE example

Deletes the specified virtual_network_rules resource.

/*+ delete */
DELETE FROM azure.sql.virtual_network_rules
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND virtualNetworkRuleName = '{{ virtualNetworkRuleName }}';