这个问题可能是由于恢复操作或存储容器的名称更改引起的。如果是这样的话,可以尝试使用以下代码来重新启动Ingestion作业:
$resourceGroupName = ""
$dataExportName = ""
$dataExport = Get-AzOperationalInsightsDataExport -ResourceGroupName $resourceGroupName -Name $dataExportName
if ($dataExport.Status -eq "Canceled" -or $dataExport.Status -eq "Failed") {
$storageAccountResourceId = $dataExport.properties.destination.storageAccountId
$storageAccountName = (Get-AzResource -ResourceId $storageAccountResourceId).Name
$storageContainerName = $dataExport.properties.destination.containerName
$dataExport.properties.destination.path = "blob/" + $storageContainerName
$dataExport = Set-AzOperationalInsightsDataExport -ResourceGroupName $resourceGroupName -Name $dataExportName -DataExport $dataExport -Confirm:$false
$clusterResourceId = $dataExport.properties.dataSource.resourceId
$clusterName = (Get-AzResource -ResourceId $clusterResourceId).Name
$databaseName = $dataExport.properties.dataSource.databaseName
$tableName = $dataExport.properties.dataSource.tableName
$timestampColumnName = ""
$timestampColumnType = ""
$uri = "https://api.kusto.windows.net/v1/rest/mgmt/clusters/$clusterName/databases/$databaseName/tables/$tableName/ingestions?ignoreSizeLimit=true"
$body = @{
"blobPaths" = [
"https://$storageAccountName.blob.core.windows.net/$storageContainerName/blob/$timestampColumnName.$timestampColumnType.gz"
]
"databaseName" = "$databaseName"
"tablePrefix" = "$tableName"."$timestampColumnName"
} | ConvertTo-Json
$authHeaderValue = Get-KustoAuthorizationHeader -ClusterUrl $uri `
-TenantId $dataExport.properties.dataSource.properties.tenantId `
-ApplicationId $dataExport.properties.dataSource.properties.appId `
-ApplicationSecret $dataExport.properties.dataSource.properties.appKey
$response = Invoke-RestMethod