To get Azure SQL resource details for all subscriptions in an azure account

My requirement is to have the response output with the failover group and secondary type details for the SQL databases created in the account for all subscriptions,

I need to list them for all subscriptions in one call or is there any other way to achieve this like using script for the Azure account other than API calls? Please help.

It would be really helpful if the script is also provided.

I know this is possible, using Azure rest API, but we could list it only for one subscription at a time. But I am expecting to have the response for all subscriptions at the same time.
In rest api, we can achieve this by [https://learn.microsoft.com/en-us/rest/api/sql/databases/list-by-server?view=rest-sql-2021-11-01&tabs=HTTP],
but can I get the similar response with the details I mentioned?

Please find the properties of SQL Databases I needed in the response output for all subscriptions :

  1. failoverGroupId
  2. secondaryType

Please find the image I got in API response, to understand the property details I needed is similar to this

Read more here: Source link