How Not To Create Your Service Principals for VSTS/ARM Connections

Hello! I’ve recently started a new project, and we’re going to use VSTS for the build and release pipeline. This includes deploying infrastructure from ARM templates. This is going to provide its own set of challenges, in that the VSTS Team is new and there is no authentication between VSTS and the Subscription the objects are deploying to. So it really is a “green field” project. But this is a good thing, as we get to deploy as much as we can from source control and limit the interaction with the Azure Portal. [Read More]

Musings March 2017 - Project Updates

Hello! I’m due to sit an exam this week, the excitingly titled “Designing and Implementing Cloud Data Platform Solutions”. Revision is hard going, as my ability to concentrate on reading pretty much anything seems to be less an less potent as I get older. And so by way of a distraction/procrastination, I thought I’d write a brief summary of some of the changes I’ve made to projects in GitHub this month. [Read More]

Syncing SSAS Databases Confusion

Hello! I’ve been playing around with a PowerShell module called RunSyncRun that I’ve never quite got around to completing. What it aims to do is to execute the sync function between SSAS Databases. Part of the problem is that it takes a while to get a test environment set up, but I finally got the WideWorldImporters sample project up and running as a good place to start. The crux of the whole module is to run this relatively small piece of xmla found in StartDatabaseSync - [Read More]

The Mystery Of The Failing Azure Cmdlet

Hello! I’ve been helping out a team with setting up a deployment pipeline that uses Azure Data Lake Store, and so the obvious way to do this is to make use of the AzureRM.DataLakeStore PowerShell module. For those of you not ITK, Microsoft provide a set of PowerShell cmdlets that make use of the Azure Resource Manager model for managing Azure resources. These can be downloaded via the PowerShell Gallery. And because there are a fairly large amount of cmdlets, these are split into subsets, such as the aforementioned AzureRM. [Read More]

On The Move

This is the first post in earnest as I begin the arduous task of migrating away from BlueHost/WordPress and their paid services to a free static web site.

Write-Host "I have no idea what I am doing."

PowerShell Snippet #12 - Creating Arrays of HashTables in PowerShell

Hello! As part of SQLDWSchemaMigrate there is a function called Compare-Rows, which finds if there is a difference between the number of columns for a given table that exists on both source and target tables. And I need to return a hash table of the schema/table where there is a mismatch wrt column count. What makes this a challenge is that hash tables cannot store duplicate keys. I was setting the key to the schema name, so theoretically I could just set the value to the schema and the key to the table. [Read More]

Execute Multiple Files Using SQLCMD or SQLClient - Which Is Faster?

Hello! I’ve been working on a PowerShell module that will migrate the schema of an Azure Data Warehouse from one database to another. The process has through quite a few iterations, and at one point I was heavily using sqlcmd utility to execute each “CREATE [OBJECT]” statement. Whilst this proved effective when playing around with a small database, when I tested the module against a real ADW it became clear that this process was far too slow. [Read More]

PowerShell Snippet #11 - PsBoundParams

Hello! There are many things I like about PowerShell, one of which is the automatic variables that are created. For example, $PsScriptRoot is set to the location of the running script (and if you run $PsScriptRoot in a .psm1 file, it sets $PSScriptRoot as the path of the file as opposed to the script.) And one of the automatic variables that I recently discovered is “PsBoundParams”. This handy little variable is a hash table that keeps track of what parameters have had arguements passed to them in either a script of a function. [Read More]

Deploy Dacpacs with dbatools The Script

Hello! Not so long ago, I wrote about how dbatools now has functions that can be used to deploy dacpacs. What I didn’t actually include was a script to do same, so without further ado, below is a script that makes use of Publish-DbaDacpac - There is also a -Verbose option. But even without it a successful deployment will spit out quite a bit of information - And of course, if you run Get-Help Publish-DbaDacpac, you get the built in help - [Read More]