Skip to main content

labels

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

Overview

Namelabels
TypeResource
Idazure.defender.labels

Fields

The following fields are returned by SELECT queries:

Label details.

NameDatatypeDescription
propertiesobjectLabel properties

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_workspaceselectresourceGroupName, subscriptionId, workspaceName, labelNameReturns a label in the given workspace.
list_by_workspaceselectresourceGroupName, subscriptionId, workspaceNameReturns a list of labels in the given workspace.
create_and_updateinsertresourceGroupName, subscriptionId, workspaceName, labelNameCreate or update a Label.
updateupdateresourceGroupName, subscriptionId, workspaceName, labelNameUpdate a Label.
deletedeleteresourceGroupName, subscriptionId, workspaceName, labelNameDelete a Label.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
labelNamestringThe name of the Label.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstringThe ID of the target subscription.
workspaceNamestringThe name of the Workspace.

SELECT examples

Returns a label in the given workspace.

SELECT
properties
FROM azure.defender.labels
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND workspaceName = '{{ workspaceName }}' -- required
AND labelName = '{{ labelName }}' -- required
;

INSERT examples

Create or update a Label.

INSERT INTO azure.defender.labels (
data__properties,
resourceGroupName,
subscriptionId,
workspaceName,
labelName
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ workspaceName }}',
'{{ labelName }}'
RETURNING
properties
;

UPDATE examples

Update a Label.

UPDATE azure.defender.labels
SET
data__properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND workspaceName = '{{ workspaceName }}' --required
AND labelName = '{{ labelName }}' --required
RETURNING
properties;

DELETE examples

Delete a Label.

DELETE FROM azure.defender.labels
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND workspaceName = '{{ workspaceName }}' --required
AND labelName = '{{ labelName }}' --required
;