Azure sql database export firewall rules

sakuraime 2,351 Reputation points
2021-06-22T13:03:35.24+00:00

How to export the Azure sql database firewall rules for Virtual network service endpoint??
108186-image.png

Azure SQL Database
0 comments No comments
{count} votes

Answer accepted by question author
  1. Saurabh Sharma 23,866 Reputation points Microsoft Employee Moderator
    2021-06-22T23:46:08.02+00:00

    Hi @sakuraime ,

    Thanks for using Microsoft Q&A !!

    When a VNET (technically, a subnet) which has Service Endpoint enabled for Azure.Sql, is added to the list of subnets allowed to connect to SQL. As such, it is mutually exclusive from the list of firewall rules which exist for public connections.
    Basically, to allow list all traffic from a subnet to SQL Db it's a two step process i.e.

    1. Enable Service Endpoints on the subnet with Microsoft.Sql
    2. On the SQL Database --> Firewalls, add a new Vnet firewall rule referencing that Vnet and Subnet.

    And such VNET firewall rules can be enumerated via. API and CLI as well. PowerShell example:
    108287-image.png

    Please let me know if you have any other questions.

    Thanks
    Saurabh

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.