public void MonitorPipelineRuns() { #region Snippet:CreateMonitoringClient string endpoint = TestEnvironment.EndpointUrl; MonitoringClient client = new MonitoringClient(new Uri(endpoint), new DefaultAzureCredential()); #endregion #region Snippet:GetSparkJobList SparkJobListViewResponse sparkJobList = client.GetSparkJobList(); foreach (var sparkJob in sparkJobList.SparkJobs) { if (sparkJob.State == "Running") { Console.WriteLine($"{sparkJob.Name} has been running for {sparkJob.RunningDuration}"); } else { Console.WriteLine($"{sparkJob.Name} has been in {sparkJob.State} for {sparkJob.QueuedDuration}"); } } #endregion #region Snippet:GetSqlJobQueryString SqlQueryStringDataModel sqlQuery = client.GetSqlJobQueryString(); #endregion }
public void MonitoringSample() { #region Snippet:CreateMonitoringClient // Replace the string below with your actual endpoint url. string endpoint = "<my-endpoint-url>"; /*@@*/ endpoint = TestEnvironment.EndpointUrl; MonitoringClient client = new MonitoringClient(endpoint: new Uri(endpoint), credential: new DefaultAzureCredential()); #endregion #region Snippet:GetSparkJobList SparkJobListViewResponse sparkJobList = client.GetSparkJobList(); #endregion #region Snippet:GetSqlJobQueryString SqlQueryStringDataModel sqlQuery = client.GetSqlJobQueryString(); #endregion }
public void GetSqlJobQueryString() { #region Snippet:GetSqlJobQueryString SqlQueryStringDataModel sqlQuery = client.GetSqlJobQueryString(); #endregion }