Skip to main content

discovery_rules

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

Overview

Namediscovery_rules
TypeResource
Idazure.cloud_health.discovery_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
addRecommendedSignalsstringWhether to add all recommended signals to the discovered entities. Required. Known values are: "Enabled" and "Disabled". (Enabled, Disabled)
authenticationSettingstringReference to the name of the authentication setting which is used for querying Azure Resource Graph. The same authentication setting will also be assigned to any discovered entities. Required.
discoverRelationshipsstringWhether to create relationships between the discovered entities based on a set of built-in rules. These relationships cannot be manually deleted. Required. Known values are: "Enabled" and "Disabled". (Enabled, Disabled)
displayNamestringDisplay name.
entityNamestringName of the entity which represents the discovery rule. Note: It might take a few minutes after creating the discovery rule until the entity is created. Required.
errorobjectError details if the last discovery operation failed.
provisioningStatestringThe status of the last operation. Known values are: "Succeeded", "Failed", "Canceled", "Creating", and "Deleting". (Succeeded, Failed, Canceled, Creating, Deleting)
specificationobjectSpecification of the discovery rule defining how entities are discovered. Required.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, health_model_name, discovery_rule_name, subscription_idGet a DiscoveryRule.
list_by_health_modelselectresource_group_name, health_model_name, subscription_idtimestampList DiscoveryRule resources by HealthModel.
create_or_updateinsertresource_group_name, health_model_name, discovery_rule_name, subscription_idCreate a DiscoveryRule.
create_or_updatereplaceresource_group_name, health_model_name, discovery_rule_name, subscription_idCreate a DiscoveryRule.
deletedeleteresource_group_name, health_model_name, discovery_rule_name, subscription_idDelete a DiscoveryRule.

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
discovery_rule_namestringName of the discovery rule. Must be unique within a health model. Required.
health_model_namestringName of health model resource. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
timestampstring (date-time)Timestamp to use for the operation. When specified, the version of the resource at this point in time is retrieved. If not specified, the latest version is used. Default value is None.

SELECT examples

Get a DiscoveryRule.

SELECT
id,
name,
addRecommendedSignals,
authenticationSetting,
discoverRelationships,
displayName,
entityName,
error,
provisioningState,
specification,
systemData,
type
FROM azure.cloud_health.discovery_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND health_model_name = '{{ health_model_name }}' -- required
AND discovery_rule_name = '{{ discovery_rule_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a DiscoveryRule.

INSERT INTO azure.cloud_health.discovery_rules (
properties,
resource_group_name,
health_model_name,
discovery_rule_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ health_model_name }}',
'{{ discovery_rule_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

REPLACE examples

Create a DiscoveryRule.

REPLACE azure.cloud_health.discovery_rules
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND health_model_name = '{{ health_model_name }}' --required
AND discovery_rule_name = '{{ discovery_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete a DiscoveryRule.

DELETE FROM azure.cloud_health.discovery_rules
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND health_model_name = '{{ health_model_name }}' --required
AND discovery_rule_name = '{{ discovery_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;