Share via


Tag Rules - Create Or Update

Create a TagRule

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}?api-version=2021-09-01

URI Parameters

Name In Required Type Description
monitorName
path True

string

Monitor resource name

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

ruleSetName
path True

string

Monitor resource name

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Type Description
properties.logRules

LogRules

Set of rules for sending logs for the Monitor resource.

properties.metricRules

MetricRules

Set of rules for sending metrics for the Monitor resource.

Responses

Name Type Description
200 OK

TagRule

ARM operation completed successfully.

201 Created

TagRule

ARM create operation completed successfully.

Other Status Codes

ErrorResponse

Common error response for all Azure Resource Manager APIs to return error details for failed operations.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

TagRules_CreateOrUpdate_MaximumSet_Gen
TagRules_CreateOrUpdate_MinimumSet_Gen

TagRules_CreateOrUpdate_MaximumSet_Gen

Sample request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/tagRules/default?api-version=2021-09-01

{
  "properties": {
    "logRules": {
      "sendAadLogs": "Enabled",
      "sendSubscriptionLogs": "Enabled",
      "sendActivityLogs": "Enabled",
      "filteringTags": [
        {
          "name": "Environment",
          "value": "Prod",
          "action": "Include"
        },
        {
          "name": "Environment",
          "value": "Dev",
          "action": "Exclude"
        }
      ]
    },
    "metricRules": {
      "filteringTags": [
        {
          "name": "Environment",
          "value": "Prod",
          "action": "Include"
        }
      ]
    },
    "provisioningState": "Accepted"
  }
}

Sample response

{
  "properties": {
    "logRules": {
      "sendAadLogs": "Enabled",
      "sendSubscriptionLogs": "Enabled",
      "sendActivityLogs": "Enabled",
      "filteringTags": [
        {
          "name": "Environment",
          "value": "Prod",
          "action": "Include"
        },
        {
          "name": "Environment",
          "value": "Dev",
          "action": "Exclude"
        }
      ]
    },
    "metricRules": {
      "filteringTags": [
        {
          "name": "Environment",
          "value": "Prod",
          "action": "Include"
        }
      ]
    },
    "provisioningState": "Accepted"
  },
  "systemData": {
    "createdBy": "alice@microsoft.com",
    "createdByType": "User",
    "createdAt": "2021-07-16T04:25:21.040Z",
    "lastModifiedBy": "alice@microsoft.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2021-07-16T04:25:21.040Z"
  },
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/tagRules/default",
  "name": "default",
  "type": "Dynatrace.Observability/monitors/tagRules"
}
Azure-AsyncOperation: https://foo.com/operationstatus
{
  "properties": {
    "logRules": {
      "sendAadLogs": "Enabled",
      "sendSubscriptionLogs": "Enabled",
      "sendActivityLogs": "Enabled",
      "filteringTags": [
        {
          "name": "Environment",
          "value": "Prod",
          "action": "Include"
        },
        {
          "name": "Environment",
          "value": "Dev",
          "action": "Exclude"
        }
      ]
    },
    "metricRules": {
      "filteringTags": [
        {
          "name": "Environment",
          "value": "Prod",
          "action": "Include"
        }
      ]
    },
    "provisioningState": "Accepted"
  },
  "systemData": {
    "createdBy": "alice@microsoft.com",
    "createdByType": "User",
    "createdAt": "2021-07-16T04:25:21.040Z",
    "lastModifiedBy": "alice@microsoft.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2021-07-16T04:25:21.040Z"
  },
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/tagRules/default",
  "name": "default",
  "type": "Dynatrace.Observability/monitors/tagRules"
}

TagRules_CreateOrUpdate_MinimumSet_Gen

Sample request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/tagRules/default?api-version=2021-09-01

{
  "properties": {}
}

Sample response

{
  "properties": {}
}
Azure-AsyncOperation: https://foo.com/operationstatus
{
  "properties": {}
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

FilteringTag

The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them from being monitored.

LogRules

Set of rules for sending logs for the Monitor resource.

MetricRules

Set of rules for sending metrics for the Monitor resource.

ProvisioningState

Provisioning state of the monitoring resource

SendAadLogsStatus

Indicates whether AAD logs are being sent.

SendActivityLogsStatus

Indicates whether activity logs are being sent.

SendSubscriptionLogsStatus

Indicates whether subscription logs are being sent.

systemData

Metadata pertaining to creation and last modification of the resource.

TagAction

Valid actions for a filtering tag. Exclusion takes priority over inclusion.

TagRule

Tag rules for a monitor resource

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

FilteringTag

The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them from being monitored.

Name Type Description
action

TagAction

Valid actions for a filtering tag. Exclusion takes priority over inclusion.

name

string

The name (also known as the key) of the tag.

value

string

The value of the tag.

LogRules

Set of rules for sending logs for the Monitor resource.

Name Type Description
filteringTags

FilteringTag[]

List of filtering tags to be used for capturing logs. This only takes effect if SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.

sendAadLogs

SendAadLogsStatus

Flag specifying if AAD logs should be sent for the Monitor resource.

sendActivityLogs

SendActivityLogsStatus

Flag specifying if activity logs from Azure resources should be sent for the Monitor resource.

sendSubscriptionLogs

SendSubscriptionLogsStatus

Flag specifying if subscription logs should be sent for the Monitor resource.

MetricRules

Set of rules for sending metrics for the Monitor resource.

Name Type Description
filteringTags

FilteringTag[]

List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.

ProvisioningState

Provisioning state of the monitoring resource

Value Description
Accepted
Creating
Updating
Deleting
Succeeded
Failed
Canceled
Deleted
NotSpecified

SendAadLogsStatus

Indicates whether AAD logs are being sent.

Value Description
Enabled
Disabled

SendActivityLogsStatus

Indicates whether activity logs are being sent.

Value Description
Enabled
Disabled

SendSubscriptionLogsStatus

Indicates whether subscription logs are being sent.

Value Description
Enabled
Disabled

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

TagAction

Valid actions for a filtering tag. Exclusion takes priority over inclusion.

Value Description
Include
Exclude

TagRule

Tag rules for a monitor resource

Name Type Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

The name of the resource

properties.logRules

LogRules

Set of rules for sending logs for the Monitor resource.

properties.metricRules

MetricRules

Set of rules for sending metrics for the Monitor resource.

properties.provisioningState

ProvisioningState

Provisioning state of the resource.

systemData

systemData

System metadata for this resource.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"