Azure has a REST API you can use for that. Here:
https://learn.microsoft.com/en-us/rest/api/sql/servers/get?view=rest-sql-2021-11-01&tabs=HTTP
GET:
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers?api-version=2021-02-01
This will list all of them on the defined resource group.
If you know the exact server name, you can list just for that too. So the end like this
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases?api-version=2021-11-01
Does this help?