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

System Topics - Create Or Update

创建系统主题。
使用指定的参数异步创建一个新的系统主题。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}?api-version=2025-02-15

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

用户订阅中的资源组的名称。

subscriptionId
path True

string

唯一标识Microsoft Azure 订阅的订阅凭据。 订阅 ID 构成了每个服务调用的 URI 的一部分。

systemTopicName
path True

string

系统主题的名称。

api-version
query True

string

要用于客户端请求的 API 的版本。

请求正文

名称 必需 类型 说明
___location True

string

资源的位置。

identity

IdentityInfo

资源的标识信息。

properties.source

string

系统主题的源。

properties.topicType

string

系统主题的 TopicType。

tags

object

资源的标记。

响应

名称 类型 说明
200 OK

SystemTopic

还行

201 Created

SystemTopic

创建

Other Status Codes

错误响应: ***

  • 400 错误的请求。

  • 500 内部服务器错误。

示例

SystemTopics_CreateOrUpdate

示例请求

PUT https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic1?api-version=2025-02-15

{
  "properties": {
    "source": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e",
    "topicType": "microsoft.storage.storageaccounts"
  },
  "___location": "westus2",
  "tags": {
    "tag1": "value1",
    "tag2": "value2"
  }
}

示例响应

{
  "properties": {
    "provisioningState": "Succeeded",
    "source": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e",
    "topicType": "microsoft.storage.storageaccounts",
    "metricResourceId": "183c0fb1-17ff-47b6-ac77-5a47420ab01e"
  },
  "___location": "centraluseuap",
  "tags": null,
  "id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic2",
  "name": "exampleSystemTopic2",
  "type": "Microsoft.EventGrid/systemTopics"
}
{
  "properties": {
    "provisioningState": "Succeeded",
    "source": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e",
    "topicType": "microsoft.storage.storageaccounts",
    "metricResourceId": "183c0fb1-17ff-47b6-ac77-5a47420ab01e"
  },
  "___location": "centraluseuap",
  "tags": null,
  "id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic2",
  "name": "exampleSystemTopic2",
  "type": "Microsoft.EventGrid/systemTopics"
}

定义

名称 说明
createdByType

创建资源的标识的类型。

IdentityInfo

资源的标识信息。

IdentityType

使用的托管标识的类型。 类型“SystemAssigned,UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将删除任何标识。

ResourceProvisioningState

专用终结点连接的预配状态。

systemData

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

SystemTopic

EventGrid 系统主题。

UserIdentityProperties

有关用户标识的信息。

createdByType

创建资源的标识的类型。

说明
Application
Key
ManagedIdentity
User

IdentityInfo

资源的标识信息。

名称 类型 说明
principalId

string

资源标识的主体 ID。

tenantId

string

资源的租户 ID。

type

IdentityType

使用的托管标识的类型。 类型“SystemAssigned,UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将删除任何标识。

userAssignedIdentities

<string,  UserIdentityProperties>

与资源关联的用户标识列表。 用户标识字典密钥引用的格式为 ARM 资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 此属性当前未使用,并保留以供将来使用。

IdentityType

使用的托管标识的类型。 类型“SystemAssigned,UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将删除任何标识。

说明
None
SystemAssigned
SystemAssigned, UserAssigned
UserAssigned

ResourceProvisioningState

专用终结点连接的预配状态。

说明
Canceled
Creating
Deleting
Failed
Succeeded
Updating

systemData

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

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

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

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

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

SystemTopic

EventGrid 系统主题。

名称 类型 说明
id

string

资源的完全限定标识符。

identity

IdentityInfo

资源的标识信息。

___location

string

资源的位置。

name

string

资源的名称。

properties.metricResourceId

string

系统主题的指标资源 ID。

properties.provisioningState

ResourceProvisioningState

系统主题的预配状态。

properties.source

string

系统主题的源。

properties.topicType

string

系统主题的 TopicType。

systemData

systemData

与事件网格资源相关的系统元数据。

tags

object

资源的标记。

type

string

资源的类型。

UserIdentityProperties

有关用户标识的信息。

名称 类型 说明
clientId

string

用户分配标识的客户端 ID。

principalId

string

用户分配标识的主体 ID。