QuestionQ111

VerifiedImplement a secure environment

You have the on-premises networks shown in the following table.

Scenario Image

You have an Azure subscription that contains an Azure SQL Database server named SQL1. SQL1 contains two databases named DB1 and DB2.

You need to configure access to DB1 and DB2. The solution must meet the following requirements:

  • Ensure that DB1 can be accessed only by users in Branch1.
  • Ensure that DB2 can be accessed only by users in Branch2.

Solution: Connect to the master database of SQL1 and run the following command.

EXECUTE sp_set_firewall_rule ‘Allow db1 and db2 users’, ‘131.107.11.0’, ‘131.107.11.255’  

Does this meet the goal?

Explanation

sp_set_firewall_rule creates a server-level IP firewall rule, which enables the specified clients to access every database on the logical SQL server. Allowing the 131.107.11.0–131.107.11.255 range therefore permits Branch2 to access both DB1 and DB2, rather than restricting DB1 to Branch1. Database-specific access requires database-level firewall rules configured separately for the relevant databases.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!