diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_alert_configuration_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_alert_configuration_async.py index 649e32b0cefc..27163928de8c 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_alert_configuration_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_alert_configuration_async.py @@ -325,5 +325,4 @@ async def main(): await sample_delete_alert_config_async(alert_config.id) if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) + asyncio.run(main()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_authentication_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_authentication_async.py index 8588c30e8a6b..f2420eb1f3aa 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_authentication_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_authentication_async.py @@ -84,5 +84,4 @@ async def main(): if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) + asyncio.run(main()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_data_feeds_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_data_feeds_async.py index 70f3f2ea8571..f05f721a9ff9 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_data_feeds_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_data_feeds_async.py @@ -227,5 +227,4 @@ async def main(): if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) + asyncio.run(main()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_datasource_credentials_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_datasource_credentials_async.py index f078afa2ebfb..7027301b8cc9 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_datasource_credentials_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_datasource_credentials_async.py @@ -142,5 +142,4 @@ async def main(): await sample_delete_datasource_credential_async(credential.id) if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) \ No newline at end of file + asyncio.run(main()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_detection_configuration_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_detection_configuration_async.py index d9f55e2dbfb1..00281d8a06bd 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_detection_configuration_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_detection_configuration_async.py @@ -264,5 +264,4 @@ async def main(): if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) + asyncio.run(main()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_feedback_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_feedback_async.py index e7404a250b81..aef465ab50f1 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_feedback_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_feedback_async.py @@ -118,5 +118,4 @@ async def main(): if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) + asyncio.run(main()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_hooks_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_hooks_async.py index f7e85a545d22..0c21afaae164 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_hooks_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_hooks_async.py @@ -162,5 +162,4 @@ async def main(): if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) + asyncio.run(main()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py index f9038d01ac54..e9baf55b5763 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py @@ -116,6 +116,4 @@ async def main(): await sample_list_incidents_for_alert_async() if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - + asyncio.run(main()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_ingestion_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_ingestion_async.py index 206054daf878..bde692fb8e91 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_ingestion_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_ingestion_async.py @@ -111,5 +111,4 @@ async def main(): if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) + asyncio.run(main()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py index f48063054bef..bda6eae313ba 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py @@ -202,5 +202,4 @@ async def main(): await sample_list_metric_enrichment_status_async() if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) + asyncio.run(main())