There is a Query Store in Azure Database for PostgreSQL, which you can use to analyze your workload and detect long running queries and CPU consuming queries.
https://learn.microsoft.com/en-us/azure/postgresql/single-server/concepts-query-store
The Query Store includes a store for wait statistics, and there is an additional capture mode query that governs wait statistics: pgms_wait_sampling.query_capture_mode can be set to none or all. The pg_qs.query_capture_mode supersedes pgms_wait_sampling.query_capture_mode. If pg_qs.query_capture_mode is none, the pgms_wait_sampling.query_capture_mode setting has no effect.
https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential
Additionally, you can use the Azure DataFactory Management client library for .NET to interact with Azure resources, including databases.