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

File Imports - Create

创建文件导入。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}?api-version=2025-04-01-preview

URI 参数

名称 必需 类型 说明
fileImportId
path True

string

文件导入 ID

resourceGroupName
path True

string

minLength: 1
maxLength: 90

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

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

workspaceName
path True

string

minLength: 1
maxLength: 90
pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$

工作区的名称。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

请求正文

名称 必需 类型 说明
properties.contentType True

FileImportContentType

此文件的内容类型。

properties.importFile True

FileMetadata

表示导入的文件。

properties.ingestionMode True

IngestionMode

介绍如何引入文件中的记录。

properties.source True

string

文件中数据的源。

响应

名称 类型 说明
200 OK

FileImport

成功

201 Created

FileImport

已创建

Other Status Codes

ErrorResponse

描述作失败的原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

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

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Create a file import.

示例请求

PUT https://management.azure.com/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/fileImports/73e01a99-5cd7-4139-a149-9f2736ff2ab5?api-version=2025-04-01-preview

{
  "properties": {
    "source": "mySource",
    "importFile": {
      "fileName": "myFile.json",
      "fileSize": 4653,
      "fileFormat": "JSON"
    },
    "contentType": "StixIndicator",
    "ingestionMode": "IngestAnyValidRecords"
  }
}

示例响应

{
  "id": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/FileImports/73e01a99-5cd7-4139-a149-9f2736ff2ab5",
  "name": "73e01a99-5cd7-4139-a149-9f2736ff2ab5",
  "type": "Microsoft.SecurityInsights/FileImports",
  "properties": {
    "importFile": {
      "fileName": "myFile.json",
      "fileSize": 4653,
      "fileFormat": "JSON",
      "fileContentUri": "https://sentinelimportswus2.blob.core.windows.net/78c2e51a-3cd3-4ca0-a2d4-e7effb9a05fe/43967a5e-47a7-474e-afb8-2081e9b99ca1/fileName.json?skoid=<skoid>&sktid=<sktid>&skt=2022-03-25T21%3A12%3A51Z&ske=2022-03-25T22%3A12%3A51Z&sks=b&skv=2020-10-02&sv=2020-08-04&st=2022-03-25T21%3A12%3A51Z&se=2022-03-25T22%3A12%3A51Z&sr=b&sp=c&sig=<signature>",
      "deleteStatus": "NotDeleted"
    },
    "state": "WaitingForUpload",
    "contentType": "StixIndicator",
    "ingestionMode": "IngestAnyValidRecords",
    "totalRecordCount": null,
    "validRecordCount": null,
    "ingestedRecordCount": null,
    "createdTimeUTC": "2022-04-04T20:05:59.847136Z",
    "filesValidUntilTimeUTC": "2022-04-05T20:05:59.8471361Z",
    "importValidUntilTimeUTC": "2022-05-04T20:05:59.8471366Z",
    "source": "mySource"
  }
}
{
  "id": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/FileImports/73e01a99-5cd7-4139-a149-9f2736ff2ab5",
  "name": "73e01a99-5cd7-4139-a149-9f2736ff2ab5",
  "type": "Microsoft.SecurityInsights/FileImports",
  "properties": {
    "importFile": {
      "fileName": "myFile.json",
      "fileSize": 4653,
      "fileFormat": "JSON",
      "fileContentUri": "https://sentinelimportswus2.blob.core.windows.net/78c2e51a-3cd3-4ca0-a2d4-e7effb9a05fe/43967a5e-47a7-474e-afb8-2081e9b99ca1/fileName.json?skoid=<skoid>&sktid=<sktid>&skt=2022-03-25T21%3A12%3A51Z&ske=2022-03-25T22%3A12%3A51Z&sks=b&skv=2020-10-02&sv=2020-08-04&st=2022-03-25T21%3A12%3A51Z&se=2022-03-25T22%3A12%3A51Z&sr=b&sp=c&sig=<signature>",
      "deleteStatus": "NotDeleted"
    },
    "state": "WaitingForUpload",
    "contentType": "StixIndicator",
    "ingestionMode": "IngestAnyValidRecords",
    "totalRecordCount": null,
    "validRecordCount": null,
    "ingestedRecordCount": null,
    "createdTimeUTC": "2022-04-04T20:05:59.847136Z",
    "filesValidUntilTimeUTC": "2022-04-05T20:05:59.8471361Z",
    "importValidUntilTimeUTC": "2022-05-04T20:05:59.8471366Z",
    "source": "mySource"
  }
}

定义

名称 说明
createdByType

创建资源的标识的类型。

DeleteStatus

指示文件是否已从存储帐户中删除。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

fileFormat

文件的格式

FileImport

表示 Azure Security Insights 中的文件导入。

FileImportContentType

此文件的内容类型。

FileImportState

文件导入的状态。

FileMetadata

表示文件。

IngestionMode

介绍如何引入文件中的记录。

systemData

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

ValidationError

描述在验证过程中在文件中遇到的错误。

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

DeleteStatus

指示文件是否已从存储帐户中删除。

说明
Deleted

文件已删除。

NotDeleted

文件未删除。

Unspecified

未指定

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

fileFormat

文件的格式

说明
CSV

CSV 文件。

JSON

JSON 文件。

Unspecified

其他格式的文件。

FileImport

表示 Azure Security Insights 中的文件导入。

名称 类型 说明
id

string (arm-id)

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

name

string

资源的名称

properties.contentType

FileImportContentType

此文件的内容类型。

properties.createdTimeUTC

string (date-time)

导入文件的时间。

properties.errorFile

FileMetadata

表示错误文件(如果导入引入时出现错误或验证失败)。

properties.errorsPreview

ValidationError[]

验证过程中遇到的一些错误的有序列表。

properties.filesValidUntilTimeUTC

string (date-time)

从存储帐户中删除与此导入关联的文件的时间。

properties.importFile

FileMetadata

表示导入的文件。

properties.importValidUntilTimeUTC

string (date-time)

从数据库和历史记录中软删除文件导入记录的时间。

properties.ingestedRecordCount

integer (int32)

已成功引入的记录数。

properties.ingestionMode

IngestionMode

介绍如何引入文件中的记录。

properties.source

string

文件中数据的源。

properties.state

FileImportState

文件导入的状态。

properties.totalRecordCount

integer (int32)

文件中的记录数。

properties.validRecordCount

integer (int32)

已通过验证的记录数。

systemData

systemData

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

type

string

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

FileImportContentType

此文件的内容类型。

说明
BasicIndicator

包含具有指示器核心字段的记录的文件,以及构造 STIX 模式的可观测对象。

StixIndicator

包含 STIX 指示器的文件。

Unspecified

包含其他记录的文件。

FileImportState

文件导入的状态。

说明
FatalError

引入文件时发生致命错误。

Ingested

文件已引入。

IngestedWithErrors

文件已引入并出现错误。

InProgress

文件引入正在进行中。

Invalid

文件无效。

WaitingForUpload

等待文件上传。

Unspecified

未指定状态。

FileMetadata

表示文件。

名称 类型 说明
deleteStatus

DeleteStatus

指示文件是否已从存储帐户中删除。

fileContentUri

string

具有有效 SAS 令牌的 URI,允许上传/下载文件。

fileFormat

fileFormat

文件的格式

fileName

string

文件的名称。

fileSize

integer (int32)

文件的大小。

IngestionMode

介绍如何引入文件中的记录。

说明
IngestOnlyIfAllAreValid

检测到无效记录时,不应引入任何记录。

IngestAnyValidRecords

检测到无效记录时,仍应引入有效记录。

Unspecified

未指定

systemData

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

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

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

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

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

ValidationError

描述在验证过程中在文件中遇到的错误。

名称 类型 说明
errorMessages

string[]

错误的说明列表。

recordIndex

integer (int32)

具有错误的记录数。