private void SetKustoClient() { bool bSuccess = false; int iTryCount = 0; while (!bSuccess) { try { kustoClient = new KustoClientV2(IcmClusterConnectionString, SterlingKustoUtilProvider.Default); //kustoClusterEndPoint = "Data Source=https://sqlazureuk2.kustomfa.windows.net:443"; bSuccess = true; } catch (Exception e) { if (++iTryCount > 3) { Trace.TraceInformation("Create kusto client failed! Exception: " + e); throw e; } else { Trace.TraceInformation("Try again to create the kusto client! Exception: " + e); Thread.Sleep(15 * 1000); } } } }
public KustoContext(string shortName) { ShortName = shortName; //IcmClusterConnectionString = "Data Source=https://icmcluster.kusto.windows.net;Initial Catalog=IcmDataWarehouse;AAD Federated Security=True;dSTS Federated Security=False"; IcmClusterConnectionString = KustoClientV2.GetConnecionString(shortName); SetKustoClient(); }