In many environments, an admin is not an admin of the whole Azure SQL server and only the DB; or a developer wants to validate the database level items only.
The script as-is fails if any system view is not accessible without allowing us to run checks against a database. Splitting these into two catch blocks and simply show the checks that failed due to permissions will still offer users the ability to see improvements/things to fix instead of not knowing any of them.
In many environments, an admin is not an admin of the whole Azure SQL server and only the DB; or a developer wants to validate the database level items only.
The script as-is fails if any system view is not accessible without allowing us to run checks against a database. Splitting these into two catch blocks and simply show the checks that failed due to permissions will still offer users the ability to see improvements/things to fix instead of not knowing any of them.