private List <string> PostQueryList(string query)
        {
            LogAnalyticsQueryResults results     = PostQuery(query);
            List <string>            listResults = new List <string>();

            if (results?.tables.Length > 0)
            {
                foreach (object[] rowFields in results.tables[0].rows)
                {
                    listResults.Add(string.Join(",", rowFields));
                }
            }

            Log.Info($"list results:", ConsoleColor.DarkBlue, null, listResults);
            return(listResults);
        }
        private LogAnalyticsQueryResults PostQuery(string query)
        {
            LogAnalyticsQueryResults laResults = new LogAnalyticsQueryResults();
            string jsonBody = $"{{\"query\": \"{query}\"}}";

            try
            {
                string uri = $"{_logAnalyticsQueryEndpoint}{Config.LogAnalyticsId}/query";
                Log.Info($"post uri:{uri}", ConsoleColor.Blue, null, query);

                _laArm.Authenticate(true, _logAnalyticsAuthResource);
                _httpClient.SendRequest(
                    uri: uri,
                    authToken: _laArm.BearerToken,
                    jsonBody: jsonBody,
                    httpMethod: HttpMethod.Post);

                Log.Info($"{_httpClient.Response?.ReasonPhrase}");

                if (!_httpClient.Success)
                {
                    Log.Error("unsuccessful response:", _httpClient.Response);
                    return(null);
                }
                else
                {
                    laResults = JsonConvert.DeserializeObject <LogAnalyticsQueryResults>(_httpClient.ResponseStreamString);
                    Log.Info($"result rows count:{laResults?.tables?[0].rows?.Length}", ConsoleColor.DarkBlue);
                    Log.Debug($"result:", laResults);
                }

                return(laResults);
            }
            catch (Exception e)
            {
                Log.Exception($"post exception:{e}");
                return(null);
            }
        }