Scan Result - Run Scan

Runs the scan

POST {endpoint}/scan/datasources/{dataSourceName}/scans/{scanName}:run?runId={runId}&api-version=2023-09-01
POST {endpoint}/scan/datasources/{dataSourceName}/scans/{scanName}:run?runId={runId}&scanLevel={scanLevel}&api-version=2023-09-01

URI Parameters

Name In Required Type Description
dataSourceName
path True

string

minLength: 3
maxLength: 63
pattern: ^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$

The dataSource name.

endpoint
path True

string (url)

The scanning endpoint of your purview account. Example: https://{accountName}.purview.azure.com.

scanName
path True

string

minLength: 3
maxLength: 63
pattern: ^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$

The scan name.

api-version
query True

string

The api version to use.

runId
query True

string

minLength: 36
maxLength: 36
pattern: ^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$

The scan run id.

scanLevel
query

ScanLevelType

The scan level.

Responses

Name Type Description
202 Accepted

ScanResultWithIngestion

Success

Headers

Operation-Location: string

Other Status Codes

ErrorResponseModel

An error response received from the Scanning Service

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

ScanResult_RunScan

Sample request

POST {endpoint}/scan/datasources/testDataSourceName/scans/scan1:run?runId=138301e4-f4f9-4ab5-b734-bac446b236e7&scanLevel=Full&api-version=2023-09-01

Sample response

x-ms-request-id: 00000000-0000-0000-0000-00000000000
Operation-Location: https://exampleaccountname.purview.azure.com/scan/datasources/myDataSource/scans/myScanName/runs/138301e4-f4f9-4ab5-b734-bac446b236e7
{
  "parentId": null,
  "id": "7bcde71f-4a4e-4e01-9226-c99d15fa0f30",
  "ingestionJobId": "7bcde71f-4a4e-4e01-9226-c99d15fa0f30",
  "resourceId": "/subscriptions/4ec8b4ae-b823-43c5-90d9-7ec52a84c0c5/resourceGroups/yongyu_scan_test/providers/Microsoft.Sql/servers/yongyu-sqlservers-0724",
  "status": "Accepted",
  "diagnostics": {
    "notifications": [],
    "exceptionCountMap": {}
  },
  "startTime": "2023-07-31T01:40:22.6764952Z",
  "endTime": "2023-07-31T01:41:48.6834379Z",
  "scanRulesetVersion": 4,
  "scanRulesetType": "System",
  "scanLevelType": "Incremental",
  "errorMessage": null,
  "error": null,
  "runType": "Manual",
  "dataSourceType": "AzureSqlDatabase",
  "discoveryExecutionDetails": {
    "discoveryStartTime": "2023-07-31T01:41:14Z",
    "discoveryEndTime": "2023-07-31T01:41:14Z",
    "status": "Succeeded",
    "statistics": {
      "assets": {
        "discovered": 3,
        "classified": 0,
        "failed": 0
      }
    },
    "isErrorLogAvailable": false
  },
  "ingestionExecutionDetails": {
    "ingestionStartTime": "2023-07-31T01:41:10.8601338Z",
    "ingestionEndTime": "2023-07-31T01:41:48.6834379Z",
    "status": "Succeeded",
    "statistics": {
      "assets": {
        "succeeded": 2,
        "failed": 0,
        "processing": 0
      },
      "relationships": {
        "succeeded": 0,
        "failed": 0,
        "processing": 0
      }
    },
    "estimatedTimeRemainingInSeconds": 12,
    "isErrorLogAvailable": false
  }
}

Definitions

Name Description
DataSourceType

The data source type.

DiscoveryExecutionDetails

The discovery execution details.

ErrorModel

The error model.

ErrorResponseModel

The error response model.

IngestionExecutionDetails

The ingestion execution details.

IngestionPhaseStatus

The ingestion status.

Notification

The notification model.

ScanDiagnostics

The scan diagnostics.

ScanLevelType

Scan level type.

ScanResultWithIngestion

The scan result with ingestion.

ScanRulesetType

The scan ruleset type.

ScanRunStatus

The scan result status.

ScanStatus

The discovery status.

DataSourceType

The data source type.

Value Description
None
Fabric
AzureSubscription
AzureResourceGroup
AzureSynapseWorkspace
AzureSynapse
AdlsGen1
AdlsGen2
AmazonAccount
AmazonS3
AmazonSql
AzureCosmosDb
AzureDataExplorer
AzureFileService
AzureSqlDatabase
ArcEnabledSqlServer
AmazonPostgreSql
AzurePostgreSql
Databricks
SqlServerDatabase
AzureSqlDatabaseManagedInstance
AzureSqlDataWarehouse
AzureMySql
Hdfs
TableauServer
AzureStorage
Teradata
Oracle
PostgreSql
AmazonRedShift
DatabricksHms
SapS4Hana
SapEcc
Snowflake
PowerBI
Trident
Dataverse
DatabricksUnityCatalog

DiscoveryExecutionDetails

The discovery execution details.

Name Type Description
discoveryEndTime

string (date-time)

The discovery end time.

discoveryStartTime

string (date-time)

The discovery start time.

isErrorLogAvailable

boolean

Indicates whether the error log is available.

statistics

The discovery statistics.

status

ScanStatus

The discovery status.

ErrorModel

The error model.

Name Type Description
code

string

A unique error code that identifies the specific error.

details

ErrorModel[]

An array of nested ErrorModel objects that provides additional error details.

message

string

A human-readable error message that provides more details about the error.

target

string

The specific component that the error is associated with.

ErrorResponseModel

The error response model.

Name Type Description
error

ErrorModel

The error model.

IngestionExecutionDetails

The ingestion execution details.

Name Type Description
estimatedTimeRemainingInSeconds

integer (int64)

The estimated time remaining in seconds.

ingestionEndTime

string (date-time)

The ingestion end time.

ingestionStartTime

string (date-time)

The ingestion start time.

isErrorLogAvailable

boolean

Indicates whether the error log is available.

lastUpdatedAt

string (date-time)

The last updated time.

statistics

The ingestion statistics.

status

IngestionPhaseStatus

The ingestion status.

IngestionPhaseStatus

The ingestion status.

Value Description
None
Succeeded
Queued
InProgress
SourceUnknown
PartialSucceeded
Failed
Canceled
Canceling

Notification

The notification model.

Name Type Description
code

integer (int32)

Notification code.

message

string

Notification message.

ScanDiagnostics

The scan diagnostics.

Name Type Description
exceptionCountMap

object

Exception count map.

notifications

Notification[]

Notifications.

ScanLevelType

Scan level type.

Value Description
Full

the scan is full scan

Incremental

the scan is incremental scan

ScanResultWithIngestion

The scan result with ingestion.

Name Type Description
dataSourceType

DataSourceType

The data source type.

diagnostics

ScanDiagnostics

The scan diagnostics.

discoveryExecutionDetails

DiscoveryExecutionDetails

The discovery execution details.

endTime

string (date-time)

The scan end time.

error

ErrorModel

The error.

errorMessage

string

The error message.

id

string

The scan result identifier.

ingestionExecutionDetails

IngestionExecutionDetails

The ingestion execution details.

ingestionJobId

string

The ingestion job identifier.

parentId

string

The parent scan result identifier.

resourceId

string

The resource identifier.

runType

string

The run type.

scanLevelType

ScanLevelType

Scan level type.

scanRulesetType

ScanRulesetType

The scan ruleset type.

scanRulesetVersion

integer (int32)

The scan ruleset version.

startTime

string (date-time)

The scan start time.

status

ScanRunStatus

The scan result status.

ScanRulesetType

The scan ruleset type.

Value Description
Custom

the scan ruleset type is custom

System

the scan ruleset type is system default

ScanRunStatus

The scan result status.

Value Description
Accepted

the scan is accepted

InProgress

the scan is InProgress

TransientFailure

the scan is in transient failure

Succeeded

the scan is succeeded

Failed

the scan is failed

Canceled

the scan is canceled

ScanStatus

The discovery status.

Value Description
Queued
Running
Succeeded
Failed
Cancelled
Delayed
Throttled
CompletedWithExceptions
CompleteWithWarning