0

I'm using Azure JS SDK for interacting with Postgres in Azure (@azure/arm-postgresql, @azure/identity, @azure/functions ...). I'd like to get the underlying REST Api for debugging purpose.

For example I'd like to know during the runtime the corresponding Rest API orders :

 const postgresCli = new PostgreSQLManagementClient(new DefaultAzureCredential(), subscriptionId);
 const fwRules = postgresCli.firewallRules.listByServer(azResourceGroup, azPostgresServerName);

Do you know if that's possible ?

Regards,

Blured.

Ecstasy
  • 1,866
  • 1
  • 9
  • 17
Blured Derulb
  • 201
  • 3
  • 12
  • You can refer to [Azure REST libraries for JavaScript](https://devblogs.microsoft.com/azure-sdk/azure-rest-libraries-for-javascript/), [Azure Database for PostgreSQL REST API](https://learn.microsoft.com/en-us/rest/api/postgresql/) and [Building a REST API for Azure PostgreSQL Using Azure Functions With Node JS](https://medium.com/swlh/building-a-rest-api-for-azure-postgresql-using-azure-functions-with-node-js-e33f1d7a1f4e) – Ecstasy Apr 25 '22 at 10:00
  • 1
    Thanks for your links. I wanted to use the existing sdk calls and get the relevant created rest api calls displayed in logs. And then analyse the calls. The reason is that I've got a strange behaviour when I'm executing my code in a serverless function. Probably because of a auth difference between my local and the serverless context. So I will open an issue in the github project to ask for some kind of rest logs when we run those sdk order. – Blured Derulb Apr 25 '22 at 10:24
  • [Generate the rest API orders for debugging purpose when calling something from azure sdk](https://github.com/Azure/azure-sdk-for-js/issues/21587) – Ecstasy Apr 27 '22 at 10:33

1 Answers1

1

You can turn on more detailed logging by following the instructions at https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/postgresql/arm-postgresql/README.md#logging

Another quick way is to set environment variable DEBUG=azure*

Jeremy Meng
  • 420
  • 1
  • 4
  • 12