async ingestFromBlob()

in packages/azure-kusto-ingest/src/ingestClientBase.ts [55:83]


    async ingestFromBlob(
        blob: string | BlobDescriptor,
        ingestionProperties?: IngestionPropertiesInput,
        maxRetries: number = KustoIngestClientBase.MaxNumberOfRetryAttempts,
    ): Promise<IngestionResult> {
        this.ensureOpen();
        const props = this._getMergedProps(ingestionProperties);

        const descriptor = blob instanceof BlobDescriptor ? blob : new BlobDescriptor(blob);

        const authorizationContext = await this.resourceManager.getAuthorizationContext();
        const ingestionBlobInfo = new IngestionBlobInfo(descriptor, props, authorizationContext, this.applicationForTracing, this.clientVersionForTracing);

        const reportToTable = props.reportLevel !== ReportLevel.DoNotReport && props.reportMethod !== ReportMethod.Queue;

        if (reportToTable) {
            const statusTableClient = await this.resourceManager.createStatusTable();
            const status = this.createStatusObject(props, OperationStatus.Pending, ingestionBlobInfo);
            await putRecordInTable(statusTableClient, { ...status, partitionKey: ingestionBlobInfo.Id, rowKey: ingestionBlobInfo.Id });

            const desc = new IngestionStatusInTableDescription(statusTableClient.url, ingestionBlobInfo.Id, ingestionBlobInfo.Id);
            ingestionBlobInfo.IngestionStatusInTable = desc;
            await this.sendQueueMessage(maxRetries, ingestionBlobInfo);
            return new TableReportIngestionResult(desc, statusTableClient);
        }

        await this.sendQueueMessage(maxRetries, ingestionBlobInfo);
        return new IngestionStatusResult(this.createStatusObject(props, OperationStatus.Queued, ingestionBlobInfo));
    }