通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Monitors - Create

创建监视器资源。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}?api-version=2025-06-11

URI 参数

名称 必需 类型 说明
monitorName
path True

string

minLength: 2
maxLength: 32
pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]+$

监视资源名称

resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 此名称不区分大小写。

subscriptionId
path True

string

minLength: 1

目标订阅的 ID。

api-version
query True

string

minLength: 1

要用于此操作的 API 版本。

请求正文

名称 必需 类型 说明
location True

string

资源所在的地理位置

identity

IdentityProperties

properties

MonitorProperties

特定于监视资源的属性。

sku

ResourceSku

tags

object

资源标记。

响应

名称 类型 说明
200 OK

DatadogMonitorResource

资源“DatadogMonitorResource”更新作成功

201 Created

DatadogMonitorResource

资源“DatadogMonitorResource”创建作成功

标头

  • Azure-AsyncOperation: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

意外错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Monitors_Create

示例请求

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor?api-version=2025-06-11

{
  "location": "West US",
  "properties": {
    "datadogOrganizationProperties": {
      "name": "myOrg",
      "cspm": false,
      "enterpriseAppId": "00000000-0000-0000-0000-000000000000",
      "id": "myOrg123",
      "linkingAuthCode": "someAuthCode",
      "linkingClientId": "00000000-0000-0000-0000-000000000000",
      "resourceCollection": false
    },
    "monitoringStatus": "Enabled",
    "userInfo": {
      "name": "Alice",
      "emailAddress": "alice@microsoft.com",
      "phoneNumber": "123-456-7890"
    }
  },
  "sku": {
    "name": "free_Monthly"
  },
  "tags": {
    "Environment": "Dev"
  }
}

示例响应

{
  "name": "myMonitor",
  "type": "Microsoft.Datadog/monitors",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor",
  "location": "West US",
  "properties": {
    "datadogOrganizationProperties": {
      "name": "myOrg",
      "enterpriseAppId": null,
      "id": "myOrg123",
      "linkingAuthCode": null,
      "linkingClientId": null
    },
    "liftrResourceCategory": "MonitorLogs",
    "liftrResourcePreference": 1,
    "monitoringStatus": "Enabled",
    "provisioningState": "Succeeded"
  },
  "sku": {
    "name": "free_Monthly"
  },
  "tags": {
    "Environment": "Dev"
  }
}
{
  "name": "myMonitor",
  "type": "Microsoft.Datadog/monitors",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor",
  "location": "West US",
  "properties": {
    "datadogOrganizationProperties": {
      "name": "myOrg",
      "id": "myOrg123"
    },
    "liftrResourceCategory": "MonitorLogs",
    "liftrResourcePreference": 1,
    "monitoringStatus": "Enabled",
    "provisioningState": "Accepted"
  },
  "sku": {
    "name": "free_Monthly"
  },
  "tags": {
    "Environment": "Dev"
  }
}

定义

名称 说明
createdByType

创建资源的标识的类型。

DatadogMonitorResource

具体跟踪的资源类型可以通过使用特定属性类型将此类型别名创建。

DatadogOrganizationProperties

指定 Datadog 组织名称。 在链接到现有组织、ID、ApiKey 和 Applicationkey 的情况下,也需要使用 Applicationkey。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

IdentityProperties
LiftrResourceCategories
ManagedIdentityTypes

指定 Datadog Monitor 的标识类型。 目前,唯一允许的值是“SystemAssigned”。

MarketplaceSubscriptionStatus

指定资源的市场订阅状态的标志。 如果未及时付款,资源将处于挂起状态。

MonitoringStatus

指定是否启用或禁用资源监视的标志。

MonitorProperties

特定于监视资源的属性。

ProvisioningState
ResourceSku
systemData

与创建和上次修改资源相关的元数据。

UserInfo

包括姓名、电子邮件和(可选)电话号码。 用户信息不能为 null。

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

DatadogMonitorResource

具体跟踪的资源类型可以通过使用特定属性类型将此类型别名创建。

名称 类型 说明
id

string

资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

identity

IdentityProperties

location

string

资源所在的地理位置

name

string

资源的名称

properties

MonitorProperties

特定于监视资源的属性。

sku

ResourceSku

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

tags

object

资源标记。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

DatadogOrganizationProperties

指定 Datadog 组织名称。 在链接到现有组织、ID、ApiKey 和 Applicationkey 的情况下,也需要使用 Applicationkey。

名称 类型 说明
apiKey

string (password)

与 Datadog 组织关联的 Api 密钥。

applicationKey

string (password)

与 Datadog 组织关联的应用程序密钥。

cspm

boolean

描述云安全状况管理状态的配置。 这会收集订阅中所有资源的配置信息,并跟踪符合行业基准。

enterpriseAppId

string

用于单一登录的企业应用的 ID。

id

string

Datadog 组织的 ID。

linkingAuthCode

string (password)

用于链接到现有 Datadog 组织的身份验证代码。

linkingClientId

string (password)

用于交换身份验证令牌以链接组织的现有client_id。

name

string

Datadog 组织的名称。

redirectUri

string

用于链接的重定向 URI。

resourceCollection

boolean

描述资源收集状态的配置。 这将收集订阅中所有资源的配置信息。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

IdentityProperties

名称 类型 说明
principalId

string

标识 ID。

tenantId

string

资源的租户 ID。

type

ManagedIdentityTypes

指定 Datadog Monitor 的标识类型。 目前,唯一允许的值是“SystemAssigned”。

LiftrResourceCategories

说明
Unknown
MonitorLogs

ManagedIdentityTypes

指定 Datadog Monitor 的标识类型。 目前,唯一允许的值是“SystemAssigned”。

说明
SystemAssigned
UserAssigned

MarketplaceSubscriptionStatus

指定资源的市场订阅状态的标志。 如果未及时付款,资源将处于挂起状态。

说明
Provisioning
Active
Suspended
Unsubscribed

MonitoringStatus

指定是否启用或禁用资源监视的标志。

说明
Enabled
Disabled

MonitorProperties

特定于监视资源的属性。

名称 类型 默认值 说明
datadogOrganizationProperties

DatadogOrganizationProperties

指定 Datadog 组织名称。 在链接到现有组织、ID、ApiKey 和 Applicationkey 的情况下,也需要使用 Applicationkey。

liftrResourceCategory

LiftrResourceCategories

liftrResourcePreference

integer (int32)

资源的优先级。

marketplaceSubscriptionStatus

MarketplaceSubscriptionStatus

指定资源的市场订阅状态的标志。 如果未及时付款,资源将处于挂起状态。

monitoringStatus

MonitoringStatus

Enabled

指定是否启用或禁用资源监视的标志。

provisioningState

ProvisioningState

userInfo

UserInfo

包括姓名、电子邮件和(可选)电话号码。 用户信息不能为 null。

ProvisioningState

说明
Accepted
Creating
Updating
Deleting
Succeeded
Failed
Canceled
Deleted
NotSpecified

ResourceSku

名称 类型 说明
name

string

采用 {PlanId} 格式的 SKU 的名称。 对于 Terraform,唯一允许的值是“Linked”。

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

UserInfo

包括姓名、电子邮件和(可选)电话号码。 用户信息不能为 null。

名称 类型 说明
emailAddress

string

pattern: ^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,}$

Datadog 用于联系用户的电子邮件(如果需要)

name

string

maxLength: 50

用户名

phoneNumber

string

maxLength: 40

Datadog 用于联系用户的电话号码(如果需要)