Hi Mathew,
based on the scenerio you provided ill suggest 2 ways
Sol 1:
Single Subnet with NIC Level NSG - Place both the web frontend VM and the database VM within the same subnet. Apply an NSG directly on the NIC of the database VM to restrict traffic only from the web frontend. This provides isolation between the web frontend and the database VM.
Sol 2:
Separate Subnets with Subnet Level NSG - Create two separate subnets, one for the web frontend and one for the database VM. Apply an NSG at the subnet level for each subnet, defining the necessary network security rules. This provides segregation between the web frontend and the database VM at the subnet level.
The solutions are based on various factors like security and architecture select whichever suits your needs.
If you find this answer useful kindly accept answer