Category: Blog

  • Learning Goals–May Update

    It’s 5 months in, and this is hard. I find that the time I’ve picked each week sometimes gets bumped by other items, which do have a higher priority. More on this later.

    Extended Events

    An epic fail here for May. I started with one week and managed to get an hour watching part of a PASS session and building a few questions. However, the second week I got busy with some family stuff that impacted my work week. With deadlines and travel the third week, I skipped this.

    The third week I was gone, and the fourth, well, only a little focus, though I did start to write a short piece on using Jon Kehayias’ script to convert a trace to an XE session. We’ll see if I get this done.

    Fifth week, not sure. That Tuesday will be in the June update.

    Python

    Not a lot better than the XE stuff. Week one I had some family issues get in the way of my Friday learning and ended up skipping this as I was away from home. With a busy weekend, I didn’t make this up.

    Week 2 I was prepping for week 3. Week 3 I was gone.

    This brings me to week 4. While I like to try and do something, I really didn’t get much done during the week. I am looking to add Python questions to the mix on SSC, so I have taken a little time during the week to build a couple questions. Going through basics like lists and dictionaries helps me come up with things that I think people might not know and can get inspired to learn a little with a question. That helped me get a few things done this month.

    I did take time to go through part of a Pluralsight course in week 4, about 90 minutes of total time, some of that pausing the course so I could generate a question and practice some Python skills.

    I keep a few browser tabs open with Python links to try some problem solving, but I keep not making time.

    Moving Forward

    I didn’t travel much until mid May, but I had a very busy life outside of work and didn’t make much time to learn away from work. Fortunately my work is related to these topics, so I can take a little time for learning.

    As I close out the first half of the year, I’m somewhat disappointed with progress. I definitely continue to learn, as my job requires it, but I’m not getting the focused time in these areas. Looking forward to next year, I want to aim for topics that are more tightly integrated with work so that I get more practice. Here, even though I’m doing something, I’m not as focused.

    For June and further, I’m going to shift my times around and pick what I think are quieter times for me to get something done. Since I can ride a bike at home and watch Pluralsight, I’ll pick those times for at least passive learning. Then I’ll set aside a shorter time period, 30 minutes, for practice at other points in the week when I have found myself with time.

  • Cleaning up Azure Client IPs

    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.

    2018-05-22 08_26_04-Window

    From here, I get a list, and I can click one.

    2018-05-22 08_26_10-Window

    When I do this, I get the details of the server. On the right side of the overview are the firewall settings.

    2018-05-22 08_26_21-Window

    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.

    2018-05-22 08_28_14-Window

    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.

    2018-05-22 08_29_00-Window

    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.

  • Hands off dbatools updates

    I really like the dbatools project. This is a series of PowerShell cmdlets that are built by the community and incredibly useful for migrations between SQL Servers, but also for various administrative actions. I have a short series on these items.

    One of the downsides of an active project is that updates happen often. I know when I’m working with new versions of Redgate tools, they’ll deliver new builds to me every day if I want them (I usually don’t).

    With dbatools, I find a similar issue, though at a slightly longer scale. I’ll see a tweet or post about a new cmdlet, only to find out that I don’t have the newest version. As a result, I need to update my modules, which means I need an elevated command window, which is distracting.

    I saw a post about someone that built a SQL Agent task to update their server, which I was thinking to do until Anthony Nocentino pointed out Watch-DbaUpdate.

    Install-DbaUpdate

    There’s actually a cmdlet that does what I want. It’s Install-DbaWatchUpdate, and it’s designed to setup a scheduled task that calls Watch-DbaUpdate and updates the module. That’s what I want, so I decided to check it out.

    First, I looked at Scheduled Tasks. In Windows 10, this is the Task Scheduler from the Start menu, and surprisingly, lots of software uses this. Google, Adobe, Microsoft, etc.

    2018-05-22 16_20_00-Task Scheduler

    I then tried the –WhatIf parameter for Install-DbaWatchUpdate, but it didn’t work. I know this is a fun cmdlet, but this should work.

    2018-05-22 16_21_02-cmd - powershell (Admin)

    In any case, let me just run it. I don’t get much detail back.

    2018-05-22 16_23_34-cmd - powershell (Admin)

    If I refresh scheduled tasks, I see a dbatools version check.

    2018-05-22 16_23_50-Task Scheduler

    If you look at the details, this is triggered at midnight and runs once an hour. The PoSh executable is called and it in turn calls the Watch-DbaUpdate cmdlet, which checks for a new version and should let me know if there are updates. Since I’m at the latest version, I’ll have to see if this works.

    So far, so good.

    I even tested the Uninstall-DbaWatchUpdate and it does remove the task.

  • One Week to Music City Tech

    Next week is Music City Tech, a three day conference consisting of Coding, Agile, and Data tracks, takes place in Nashville on May 31-June 2. There are a lot of great sessions on the schedule, covering a lot of software development topics.

    I’ll be delivering two talks, one on DevOps and one on security/encryption on Saturday. I’m looking forward to the conference, with some great .NET and development talks on Thursday and Friday, with a nice spread of data talks on Saturday.

    If you’re near the area, you can get tickets for a very reasonable price for the conference. I hope to see you next week.