protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _scheduler?.Dispose(); if (_schedulerLogWriter is IDisposable schedulerLogWriter) { schedulerLogWriter?.Dispose(); } if (_alertNotifier is IDisposable alertNofier) { alertNofier?.Dispose(); } _kustoIngestClient?.Dispose(); foreach (var(_, resources) in _environmentResources) { resources.Dispose(); } } _disposedValue = true; } }
static async Task Main(string[] args) { // Async Ingestion From a Single Azure Blob using KustoQueuedIngestClient with (optional) RetryPolicy: //Create Kusto connection string with App Authentication var kustoConnectionStringBuilderDM = new KustoConnectionStringBuilder(@"https://ingest-{clusterNameAndRegion}.kusto.windows.net").WithAadApplicationKeyAuthentication( applicationClientId: "{Application Client ID}", applicationKey: "{Application Key (secret)}", authority: "{AAD TenantID or name}"); // Create an ingest client // Note, that creating a separate instance per ingestion operation is an anti-pattern. // IngestClient classes are thread-safe and intended for reuse IKustoIngestClient client = KustoIngestFactory.CreateQueuedIngestClient(kustoConnectionStringBuilderDM); // Ingest from blobs according to the required properties var kustoIngestionProperties = new KustoIngestionProperties(databaseName: "myDB", tableName: "myTable"); var sourceOptions = new StorageSourceOptions() { DeleteSourceOnSuccess = true }; //// Create your custom implementation of IRetryPolicy, which will affect how the ingest client handles retrying on transient failures IRetryPolicy retryPolicy = new NoRetry(); //// This line sets the retry policy on the ingest client that will be enforced on every ingest call from here on ((IKustoQueuedIngestClient)client).QueueRetryPolicy = retryPolicy; await client.IngestFromStorageAsync(uri : @"BLOB-URI-WITH-SAS-KEY", ingestionProperties : kustoIngestionProperties, sourceOptions); client.Dispose(); }
protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _scheduler?.Dispose(); if (_schedulerLogWriter is IDisposable schedulerLogWriter) { schedulerLogWriter?.Dispose(); } if (_alertNotifier is IDisposable alertNofier) { alertNofier?.Dispose(); } _kustoIngestClient?.Dispose(); _kustoClient?.Dispose(); } _disposedValue = true; } }
protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _scheduler?.Dispose(); _schedulerLogWriter?.Dispose(); _alertNotifier?.Dispose(); _kustoIngestClient?.Dispose(); _cslQueryProvider?.Dispose(); } _disposedValue = true; } }
public void Dispose() { _kustoClient.Dispose(); }