I travel around, and as a result, I may find myself accessing my Azure databases from different locations. Since it’s a quick click and login to add my IP from SSMS, I’ll end up with multiple ones. I don’t want to leave systems open for a long time, and certainly don’t want to just add 0.0.0.0 without good reason.
As a result, I periodically clean things up. I’d like to do this after each trip, but I sometimes forget. Here’s how I do this in the Portal.
First, I need to access my server, not my database. Servers are separate from databases, as you can see below. This isn’t an instance, but rather a logical construct for holding multiple databases.
From here, I get a list, and I can click one.
When I do this, I get the details of the server. On the right side of the overview are the firewall settings.
Click this and you see the list of firewall rules. Each of these has a name, a starting and ending IP range. You don’t really need to worry about this much if you’re a dev. If you want to give access to a group of IPs because your company has them, talk to your network admin about the addressing.
On the right side are three dots. Click these to get the delete option.
I click through these and it’s really quick. I can remove 10 IPs in about 20 seconds, so I don’t bother with too much automation here. I could use PoSh, but it might take me longer to figure out what to do than just click a few times.
I can also edit a row. If I click the middle, I get edit boxes, and as you see, I can rename a rule that makes sense. I ought to do this for other times, but since I add access from SSMS in hotels, I don’t often go to the server at that time.
It can be a pain, and if I tended to work with a lot of different servers (I have 4), I’d likely automate this more.
Actually I’ll automate it in another post as it’s a good skill to have.