Skip to main content

targets

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

Overview

Nametargets
TypeResource
Idazure.db_watcher.targets

Fields

NameDatatypeDescription
connection_server_nametextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
subscriptionIdtextfield from the properties object
targetNametextfield from the properties object
target_authentication_typetextfield from the properties object
target_typetextfield from the properties object
target_vaulttextfield from the properties object
watcherNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, subscriptionId, targetName, watcherNameGet a Target
list_by_watcherSELECTresourceGroupName, subscriptionId, watcherNameList Target resources by Watcher
create_or_updateINSERTresourceGroupName, subscriptionId, targetName, watcherNameCreate a Target
deleteDELETEresourceGroupName, subscriptionId, targetName, watcherNameDelete a Target

SELECT examples

List Target resources by Watcher

SELECT
connection_server_name,
provisioning_state,
resourceGroupName,
subscriptionId,
targetName,
target_authentication_type,
target_type,
target_vault,
watcherName
FROM azure.db_watcher.vw_targets
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';

INSERT example

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

/*+ create */
INSERT INTO azure.db_watcher.targets (
resourceGroupName,
subscriptionId,
targetName,
watcherName,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ targetName }}',
'{{ watcherName }}',
'{{ properties }}'
;

DELETE example

Deletes the specified targets resource.

/*+ delete */
DELETE FROM azure.db_watcher.targets
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND targetName = '{{ targetName }}'
AND watcherName = '{{ watcherName }}';