Linked Services - Create Or Update
创建或更新链接服务。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}?api-version=2025-07-01URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 | 
|---|---|---|---|---|
| linked | path | True | string | linkedServices 资源的名称 | 
| resource | path | True | stringminLength: 1 maxLength: 90 | 资源组的名称。 此名称不区分大小写。 | 
| subscription | path | True | stringminLength: 1 | 目标订阅的 ID。 | 
| workspace | path | True | stringminLength: 4 maxLength: 63 pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$ | 工作区的名称。 | 
| api-version | query | True | stringminLength: 1 | 要用于此操作的 API 版本。 | 
请求正文
| 名称 | 类型 | 说明 | 
|---|---|---|
| properties.provisioningState | 链接服务的预配状态。 | |
| properties.resourceId | string | 将链接到工作区的资源的资源 ID。 这应该用于链接需要读取访问权限的资源 | 
| properties.writeAccessResourceId | string | 将链接到工作区的资源的资源 ID。 这应该用于链接需要写入访问权限的资源 | 
| tags | object | 资源标记。 | 
响应
| 名称 | 类型 | 说明 | 
|---|---|---|
| 200 OK | 确定响应定义。 | |
| 201 Created | 创建了响应定义。 | |
| 202 Accepted | 接受的响应定义。 | 
安全性
azure_auth
Azure Active Directory OAuth2 流
					类型: 
					oauth2
					流向: 
					implicit
					授权 URL: 
					https://login.microsoftonline.com/common/oauth2/authorize
			
作用域
| 名称 | 说明 | 
|---|---|
| user_impersonation | 模拟用户帐户 | 
示例
LinkedServicesCreate  
			示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/TestLinkWS/linkedServices/Cluster?api-version=2025-07-01
{
  "properties": {
    "writeAccessResourceId": "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/clusters/testcluster"
  }
}
示例响应
{
  "properties": {
    "writeAccessResourceId": "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/clusters/testcluster",
    "provisioningState": "ProvisioningAccount"
  },
  "id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testlinkws/linkedservices/cluster",
  "name": "TestLinkWS/Cluster",
  "type": "Microsoft.OperationalInsights/workspaces/linkedServices"
}{
  "properties": {
    "writeAccessResourceId": "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/clusters/testcluster",
    "provisioningState": "ProvisioningAccount"
  },
  "id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testlinkws/linkedservices/cluster",
  "name": "TestLinkWS/Cluster",
  "type": "Microsoft.OperationalInsights/workspaces/linkedServices"
}定义
| 名称 | 说明 | 
|---|---|
| Linked | 顶级链接服务资源容器。 | 
| Linked | 链接服务的预配状态。 | 
LinkedService 
			
			顶级链接服务资源容器。
| 名称 | 类型 | 说明 | 
|---|---|---|
| id | string | 资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} | 
| name | string | 资源的名称 | 
| properties.provisioningState | 链接服务的预配状态。 | |
| properties.resourceId | string | 将链接到工作区的资源的资源 ID。 这应该用于链接需要读取访问权限的资源 | 
| properties.writeAccessResourceId | string | 将链接到工作区的资源的资源 ID。 这应该用于链接需要写入访问权限的资源 | 
| tags | object | 资源标记。 | 
| type | string | 资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” | 
LinkedServiceEntityStatus   
			
			链接服务的预配状态。
| 值 | 说明 | 
|---|---|
| Succeeded | |
| Deleting | |
| ProvisioningAccount | |
| Updating |