Use PowerShell to consume your Azure CLI DevOps result set

Before we get going it is probably first worth me pointing out (in case you are wondering) that the whole premise of this post stems from a lack of native Azure DevOps PowerShell Module. Yes there are a few solutions out there, but at the time of writing there is no official Microsoft PowerShell DevOps module, so we are stuck with using the CLI if you want to avoid using these other solutions.

In my post Using Azure CLI to query Azure DevOps I explained how you can use the Azure CLI to query Azure DevOps so you can obtain useful information on builds, releases, and other useful information. The solution required a certain level of skill with JMESPath to manipulate your result sets -which as explained can be a little confusing.

However once you have a bare bones result set, it is likely that you will want to consume these results in a more user-friendly environment such as PowerShell so that you can build upon these data sets. I thought this would be an easy thing to do, but as you will see below it was anything but.

A simple example

Lets write a simple Azure CLI query with JMESPath and assign the results to a PowerShell variable:
$releases = az pipelines release list --query "[].{name:name,}" --output table

If we take a quick look at the contents of the $releases variable we get the following result set:

PS C:\> $releases

Name          Pipeline
------------  ----------------------------------------------
Release-12    Databricks Pipeline
Release-11    Databricks Pipeline
Release-10    Databricks Pipeline

The problem is that this result set is coming across as an array of values rather than a tabular data-set and we can see this if we try to select a column:

PS C:\> $releases|Select-Object Name



After lots of trial and error and frustrating attempts to arrive at a solution which I would have expected to be easy to get around, I was given a great tip from Jonathan Allen (t) to try and use the ConvertFrom-String cmdlet. Using this on its own gives us the following:

PS C:\> $releases | ConvertFrom-String -PropertyNames Name, Pipeline

Name          Pipeline
------------  --------
Name          Pipeline
------------  ----------------------------------------------
Release-12    Databricks
Release-11    Databricks
Release-10    Databricks
Release-12    Pipeline
Release-11    Pipeline
Release-10    Pipeline

Clearly this looks like we are getting closer so I tried removing the header and adding an explicit delimiter into this cmdlet:

PS C:\> $releases = $releases | where-object {($_.tostring() -ne "------------  ----------------------------------------------" -And $_.tostring() -ne "Name          Pipeline")}
PS C:\> $releases | ConvertFrom-String -PropertyNames Name, Pipeline -Delimiter "  "

Name          Pipeline
----          --------
Release-12    Databricks Pipeline
Release-1      Databricks Pipeline

Unfortunately due to the fact we do not have a consistent delimiter due to the change in the first column width when our result number changes in digit size we get inconsistent formatting results as exampled above.

Back to basics

I have always been told that you should try and use PowerShell pipeline functionality to keep code brief and optimal, but try as I might I could not arrive at an acceptable solution. In the end I decided to try and return to programming basics and write code to format the result sets as I would in C# or other procedural languages.

So in a nutshell, I decided to do the following:

  • Create a table, with correct number of columns
  • Create DevOps result set array and strip the header
  • Iterate through the array and add a new row to our table containing data for each column
  • Manipulate our table in PowerShell as we want

The full solution was as follows:

$releases = az pipelines release list --query "[].{name:name,}" --output table
$table = New-Object System.Data.DataTable

# strip headers and column string
$releases = $releases | where-object {($_.tostring() -ne "------------  ----------------------------------------------" -And $_.tostring() -ne "Name          Pipeline")}
$break = 14 # where 14 is the breakpoint between columns
foreach ($row in $releases)
    $column1 = $row.ToString().Substring(0,$break)
    $column2 = $row.ToString().Substring($break,$row.ToString().Length - $break)
    $table.Rows.Add($column1, $column2) | Out-Null # Out-Null required to avoid echo to screen
$table | select Name | where {($_.Pipeline -eq "Databricks Pipeline")} | ft

And the last line of this code simply selects the Name of the last three releases where the pipeline was called Databricks Pipeline (proving that our result set is tabular).



As you can see, in those situations where our result sets are not tabular at the point of assignment to a PowerShell variable, it is still possible to convert them as you see fit. Whilst this is a little painful to initially set up (depending upon the number of columns you might have), it is a fairly repeatable pattern. It is disappointing that I could not find a pure pipeline driven solution (and I did try many different techniques including formatting strings), but if you are aware of a better solution, please let me know! If I come across a better solution myself I will update this post accordingly!

Rewrite your PowerShell AzureRm to Az for Azure DevOps deployments?

I just wanted to get a quick post out on specific problem that I have just encountered from one of our Azure DevOps release pipelines in which one of the release stage tasks started failing for no reason (despite no obvious changes having been made). Hopefully this post will help others if you are also experiencing this problem and don’t know what to do.

The error message was as follows for our task “Enable Firewall on Data Lake”

2020-02-13T12:30:51.4672549Z ##[section]Starting: Enable Firewall on Data Lake
2020-02-13T12:30:51.4779190Z ==============================================================================
2020-02-13T12:30:51.4779279Z Task : Azure PowerShell
2020-02-13T12:30:51.4779364Z Description : Run a PowerShell script within an Azure environment
2020-02-13T12:30:51.4779425Z Version : 3.153.2
2020-02-13T12:30:51.4779503Z Author : Microsoft Corporation
2020-02-13T12:30:51.4779571Z Help :
2020-02-13T12:30:51.4779656Z ==============================================================================
2020-02-13T12:30:53.6479788Z ##[command]Import-Module -Name C:\Modules\azurerm_6.7.0\AzureRM\6.7.0\AzureRM.psd1 -Global
2020-02-13T12:31:00.6580029Z ##[command]Clear-AzureRmContext -Scope Process
2020-02-13T12:31:01.3041473Z ##[command]Disable-AzureRmContextAutosave -ErrorAction Stop
2020-02-13T12:31:01.9336559Z ##[command]"D:\a\_tasks\AzurePowerShell_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\3.153.2\ps_modules\VstsAzureHelpers_\openssl\openssl.exe" pkcs12 -export -in d:\a\_temp\clientcertificate.pem -out d:\a\_temp\clientcertificate.pfx -password file:"d:\a\_temp\clientcertificatepassword.txt"
2020-02-13T12:31:02.1959058Z ##[command]Add-AzureRMAccount -ServicePrincipal -Tenant *** -CertificateThumbprint ****** -ApplicationId *** -Environment AzureCloud @processScope
2020-02-13T12:31:02.6748632Z ##[command] Select-AzureRMSubscription -SubscriptionId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -TenantId ***
2020-02-13T12:31:03.1996315Z ##[command]& 'd:\a\_temp\xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.ps1'
2020-02-13T12:31:05.7869733Z ##[command]Disconnect-AzureRmAccount -Scope Process -ErrorAction Stop
2020-02-13T12:31:06.1648969Z ##[command]Clear-AzureRmContext -Scope Process -ErrorAction Stop
2020-02-13T12:31:06.9334190Z ##[error]Exception of type 'Microsoft.Rest.Azure.CloudException' was thrown.
2020-02-13T12:31:07.0104724Z ##[section]Finishing: Enable Firewall on Data Lake

The task was configured as follows

As you can see we are simply trying to execute the following Azure RM command to configure an existing DataLakeStorage v1 resource:
Set-AzureRmDataLakeStoreAccount -ResourceGroupName myazureresourcegroup -Name myazuredlresource-AllowAzureIpState Enabled -FirewallState Enabled

As several failed attempts to re-run this task with the same error and confirmation that nothing else had changed in our environment I decided to rewrite the now deprecated AzureRm code (I have discussed this elsewhere in this blog) to Azure PowerShell Az module. The command was now as follows:
Set-AzDataLakeStoreAccount -Name myazuredlresource -FirewallState Enabled -ResourceGroupName myazureresourcegroup -AllowAzureIpState Enabled

Also, in order to use Azure PowerShell Az module we also need to change the task version to 4.* and above.

This time upon release we get success!


While it is still not clear to me that the failures we were experiencing are as a direct result of AzureRm being slowly phased out (doubtful at this stage), it is clear this particular problem is perhaps a wake up call for us all to slowly start considering converting our existing code to Az in order to future proof it in our pipelines. I will check with Microsoft for feedback on this issue to understand if there is official advise with regards to our legacy AzureRm code and update this post accordingly.

For now, I hope this resolution fixes your problem too!

Using Azure CLI to query Azure DevOps

Coding CatIn previous posts, I have touched upon the use of Azure Cloud Shell for generic querying of Azure resources and I thought it would be useful to quickly document its use for something a little more specific such as querying or manipulating Azure DevOps through the command line.

For my example, I will focus on something as mundane and straight-forward as querying the Azure DevOps repository meta-data (so that I can look at and compare branch settings against each other) but I hope you get the idea that this is just scratching the tip of the iceberg and the Azure CLI is a powerful tool to add to your arsenal of scripting languages.

The whole end-end process required to query Azure DevOps is itself is a relatively straight-forward affair -especially when you know exactly what you are doing (isn’t everything!) but before we get there, you will first need to have access to the Azure CLI. You have two ways of using it, the first being to install it locally -and instructions to do this can be found via an earlier post titled “AzureRM, Azure CLI and the PowerShell Az Module“. Alternatively, you may also use the Azure CLI through Azure Cloud Shell (i.e. directly from Azure) as detailed in another of my posts titled “Introduction to Azure Cloud Shell“.

Configure az devops pre-requisites

Once you are up and running with the Azure CLI and have access to its az command, there are a few pre-requisites needed before you can query Azure DevOps directly. These are detailed as follows:
1. You must ensure that you are running Azure CLI version 2.0.49 or higher. You can check this by simply running the following command:
az --version
az version
2. Your Azure CLI must have the azure-devops extension added to it. To check if this is already available run the following command to list your extensions:
az extension list
az extension
If the extension is not listed you can add it as follows:
az extension add --name azure-devops
added extension
For further information on this extension, you can view the Microsoft documentation titled “Use extensions with Azure CLI“.
3. Your az session must be signed in to your Azure tenant, and to do this use the az login command and provide the relevant credentials:
az login
4. Finally, to avoid having to provide a project context every time you run an az devops command you should set a default project context as follows (obviously use your own organization and project):
az devops configure --defaults organization= project="ACME Corp"

You are now ready to go!

Querying DevOps through Azure CLI

In order to find out all the commands now made available to you with your new extension, you can execute the following command:
az devops -h

By doing so, you will note that the extension provides devops subgroup commands such as teams -for example to list your current devops teams:
az devops team list

As the help context shows, the extension also provides “related groups” (such as repos) to manage other facets of Azure DevOps. In our specific example, we want to query all available repos for our Azure DevOps project. We can do this as follows:
az repos list
json results
Notice that your results come back in JSON format by default. We can override this and return results in tabular format by using the output parameter:
az repos list --output tabletable output
The Azure CLI also provides a query option so that you can provide a JMESPath query string to filter your results. For instance, in the most basic scenario we can return the first element from our results (using zero-based index notation):
az repos list --query [0]

That is clearly not so useful, so instead, I want to return specific properties from all repos. In this case, I want to return its name, Azure repo url path, and the default branch that is set:
az repos list --query [].[name,webUrl,defaultBranch]

In our final example we will return the results in a tabular format and alias our property names (for our column headings):
az repos list --query "[].{Name:name, Url:webUrl, DefaultBranch:defaultBranch}" --output tablewith aliases


Being able to programmatically query Azure DevOps through the Azure CLI is incredibly useful and powerful and could help you keep your environment standardized (for example ensure branch policies across repos are identical) or even provides a method that you can easily track change. Obviously we are not just restricted to the Azure DevOps repos, we can look at all facets of the environment. For example, to list all current builds in a project we can issue the following command:
az pipelines build list -o table

As a final point of note, I confess to finding JMESPath to query and filter my results far less intuitive or simple than with other languages (especially given the semi-structured nature of the data you are filtering), but with a little bit of trial and error, you can eventually get there!

I hope you find my post useful and please feel free to provide feedback in the comments.

Further References

Encouraging diversity at technical events – volunteers and organisers

In the third and final post of this three-part series, I will be exploring a few thoughts and ideas regarding how we can encourage diversity of volunteers and organisers at technical events. I have been organising events as far back as 2010 so I have (no doubt) been responsible for many failures (and hopefully a few successes) in promoting and hosting events to the community.

Before we start talking about diversity, I think it is first important to define what I mean by this term. According to the Merriam-Webster definition, diversity is “the condition of having or being composed of differing elements” and especially “the inclusion of different types of people (such as people of different races or cultures) in a group or organization”. I don’t quite think this extends far enough, and I see personally see diversity as the inclusion of all people regardless of their gender, sexual orientation, ability, physical appearance, age, size, race, or religion. Our aim, therefore, should be to provide a harassment-free conference experience in which everyone can enjoy this in equal measure.

The following is not a comprehensive list, but I hope it will provide some food for thought when you start planning your next event.

Understand why you are doing this

It is important that you understand why and who you are going to supplement your organiser and volunteer team. You are not trying to fill quotas here, but instead trying to build a diverse team that truly reflects all views, ideas, outlooks, and abilities. The reason why this is a good thing is it will help you implement an event that will appeal to a diverse audience (and we have already discussed why that can be a good thing). So remember, it is not quotas you are filling, but representation.

Look towards encouraging volunteers from other events and groups

It perhaps should now go without saying that you should reach out into other communities for help for your event. These people will be more attuned to meeting their own communities needs and wants, and will also be used to coping with the demands of pulling off a successful event.

Give people ownership of their responsibilities

If you are a control freak (like me), you will struggle with the idea of handing over power of any sort for your fellow organisers and volunteers to run independently of you. This kind of command structure is not conducive to team members from growing into their role and are more likely to fail. No one wants to be bossed around at an event and if they are, you are probably not going to see them wanting to join your event the next time. Most people will live up to their responsibilities if they have control, so it is important that you give them this, and offer your support where they need it.

Understand a persons strengths and appoint accordingly

Do not assume that all of your volunteers will have exactly the same abilities (or capabilities). One person might be able to stand on their feet for a large part of the day and run between rooms – but someone else might have a medical condition that could struggle with these kinds of duties.

It is important that you communicate with all of your volunteers and understand how they can most effectively participate with volunteering at your event. Assign them roles that they will not only be able to perform, but also ones that they will enjoy.

Get plenty of volunteers onboard

Not everyone can easily deal with the pressure that running an event entails. It is important that you do not put unnecessary and extreme pressure on your team members to deliver or that exposes them to too many problems. Ensure that you bring onboard plenty of volunteers so that one person is not a single point of failure to the event activities, and that everyone has plenty of support.


It is incredibly important that you try to bring onboard lots of diverse representation onto your team so that you can run a more informed and efficient event schedule that meets the demands of your audience. This representation will also act as a great way to encourage further involvement and diversity in future years and ultimately help you achieve your goals (where you alone might fail) of encouraging diversity at technical events.

I hope you have enjoyed listening to my ramblings on this topic and I am very happy to listen to your thoughts and ideas too!

Encouraging diversity at technical events – speakers

In the second of this three-part series, I will be exploring a few thoughts and ideas regarding how we can encourage diversity of speakers at technical events. I have been organising events as far back as 2010 so I have (no doubt) been responsible for many failures (and hopefully a few successes) in promoting and hosting events to the community.

Before we start talking about diversity, I think it is first important to define what I mean by this term. According to the Merriam-Webster definition, diversity is “the condition of having or being composed of differing elements” and especially “the inclusion of different types of people (such as people of different races or cultures) in a group or organization”. I don’t quite think this extends far enough, and I see personally see diversity as the inclusion of all people regardless of their gender, sexual orientation, ability, physical appearance, age, size, race, or religion. Our aim, therefore, should be to provide a harassment-free conference experience in which everyone can enjoy this in equal measure.

The following is not a comprehensive list, but I hope it will provide some food for thought when you start planning your next event.

Promote your Call For Papers through other events and groups

In a similar way that you would (if you were trying) to encourage attendees to your event, it is important that you also reach out to other community events and user groups to announce your Call For Papers. There are lots of groups like Girls Who Code and PASS Women In IT who would be a great starting point, but you should also think about even contacting non-technical groups and associations. This will give your event much more reach to communities beyond bridging more than just the gender balance and help make your speaking roster incredibly diverse, interesting, and appealing.

Seek non-technical Sessions

If you are seeking speakers from non-technical communities, it probably should go without saying that the vast majority of the potential speakers in them would be non-technical. You should be open to (and actively seek) non-technical sessions on subjects that might be of interest to a technical audience. Topics such as embracing diversity in IT or designing a workplace for mobility could be a perfect fit for your event and will appeal to a more managerial level of audience – these are the very same people that your sponsors will be keen on (those with the power to sign off purchases of products!).

Approach Speakers Directly

As an event organiser, there is always a niggling voice in the back of your mind saying “if someone cannot be bothered to submit a session then they don’t deserve to speak” but the reality is that many people do not submit to your event for a million and one reasons. It might be a confidence thing, or it might even be a fear that your event won’t be welcoming to them. This mindset will not help encourage diversity of submissions, so you should make the effort to approach those individuals directly that would traditionally not submit to your event. Remember that you are not selecting someone because they simply “fill a quota” but instead selecting someone because they bring something extra to your event. It is a bit like a music festival organiser signing some great bands for their schedule – you are almost certainly going to want the populist bands that tour everywhere, but you’ll also want to seek out those exciting new bands so that people can say “I saw them first at your festival!”.

Do not be afraid of setting diversity targets

A persistent concern that I wrestle with is the fear of positively discriminating against someone in order to “fill a quota”. It is not good for anyone if your speakers are not selected on their own merits -and they should be, but you should also not fear aiming towards (and reviewing) your diversity targets year on year. Remember that the whole point of aiming for a good diversity balance today will serve to encourage others tomorrow and remove the fear of “I can’t do this” or “I shouldn’t be here”. Remember that until your event gets an equal balance of submissions from all-comers and becomes a norm (which is probably not going to happen any time soon) you cannot truly say that selection was “fair” and you should work towards making it so.

Blind selection

Blind selection of sessions can be a good way to remove unconscious bias from the selection process, but it can also help to miss striking a good diversity balance if (as we talked about earlier) you do not have an equal representation of sessions. If you perform blind selection at your event, you should also not be afraid to review how that may have skewed your diversity targets – and not be afraid to address them for the reason given above.

Fast Call For Papers and announce your schedule early

Speakers with a young family are going to have more difficulty in speaking at your event if you do not give them enough time to make arrangements for childcare or other such considerations. The earlier that you are able to give a speaker notification of selection, the earlier they can purchase flights and accommodation at much cheaper prices. This is essential for a speaker that does not have a large disposable income, or other dependents to consider, or someone traveling from another country. I generally find that a minimum of 3 months’ notice should be given to minimize the expense to the speaker and make it more likely that they will be able to attend.

Provide Creche facilities

At the last conference I organised, I tried very hard to provide creche facilities but sadly our venue did not allow children under 16 on-premises. It was my belief that if we could provide a temporary place for children to be looked after during the event, more speakers with children would be more likely to attend and drop their child in the creche whilst they spoke. Obviously a similar argument could be made for having a creche to encourage attendees with children, though I think it is less likely for a parent to bring their child or children to a conference and want to drop them off in the Creche all day.

Avoid unisex speaker shirts

Unisex speaker shirts sound like a good idea at the time since (as an event organizer) you would only be dealing with ordering various shirt sizes rather than worrying about cut, but from personal experience, I have heard too many complaints from female speakers (to ignore) that these Unisex style shirts do not fit ladies very well. In practice, the overhead of ordering a different style of shirt is insignificant, though one problem you might run into is that commercial clothing manufacturers often only supply certain items of clothing in Unisex style. Do your best to go for alternative items of clothing where possible as your official speaker shirt since I know that this is very much appreciated and demonstrates to all speakers that you really care.

Be flexible with timeslots

Speakers with children, medical conditions, or other considerations may have to return home as soon as possible once their speaking engagement has finished. It is important that organizers try to be as flexible and accommodating as possible when drawing up an event agenda and (occasionally) be able to juggle timeslots on the day due to short notice change of circumstances. Liaising closely with your speakers about speaking arrangements will give them confidence in your ability to accommodate any known or unforeseen problems and make them more likely to be able to deliver their session.

Provide a private area for speakers

It is important that speakers have a quiet place to relax, hang out, and get away from everything. I know that many events have started to “do away” with the speaker room to encourage interaction between speakers and attendees, but some speakers might feel socially awkward and uncomfortable doing this. Remember everyone is different. You are trying to encourage people from diverse backgrounds and identities to speak at your event, so you should try and provide what they need to let them be able to be themselves.


Having a diverse speaker line up at your event is a very powerful way of encouraging new and existing talent from other communities to speak at future events as well as promoting your event further to a larger potential audience. In my opinion, it is going to take a lot of time and effort to get to a point where we won’t have to proactively need to go out and look for speakers from other communities to present at our events, but the more effort we make today, the more likely it will become the norm in the future.

Encouraging diversity at technical events – attendees

In the first of this three-part series, I will be exploring a few thoughts and ideas regarding how we can encourage diversity of attendees at technical events. I have been organising events as far back as 2010 so I have (no doubt) been responsible for many failures (and hopefully a few successes) in promoting and hosting events to the community.

Before we start talking about diversity, I think it is first important to define what I mean by this term. According to the Merriam-Webster definition, diversity is “the condition of having or being composed of differing elements” and especially “the inclusion of different types of people (such as people of different races or cultures) in a group or organization”. I don’t quite think this extends far enough, and I see personally see diversity as the inclusion of all people regardless of their gender, sexual orientation, ability, physical appearance, age, size, race, or religion. Our aim, therefore, should be to provide a harassment-free conference experience in which everyone can enjoy this in equal measure.

The following is not a comprehensive list, but I hope it will provide some food for thought when you start planning your next event.

Implement a Code of Conduct

One of the very first things we can do for our event is to implement a code of conduct for all attendees, speakers, sponsors, volunteers, and organizers to adhere to. This will act as a necessary framework to refer back to. I personally like the ability to amend and change the Code of Conduct where it becomes obvious over time that you have made a mistake or omission – but you should be careful not to change policy on a whim, get team approval, and document what and when a revision was made.

The Code of Conduct should be well publicized and kept as simple as possible to ensure that it is understood and followed by everyone at your event.

Have contact details for problems to be reported to – and make everyone aware during the event who they can speak to about any possible issues.

Ensure your event space is accessible and has adequate parking and drop-off areas

I once held a conference at an event space that had stairs and few lifts. After being contacted by a wheel-chair bound attendee in advance of an up-and-coming event, it became clear that we would have to assign a member of the volunteer staff to assist with the attendee in order for them to move from session to session. He was also arriving by train and getting a taxi to and from the event, so we also needed to arrange special dispensation into the event grounds to allow the taxi in and out since we were not allowed to use their private parking or access and the nearest public car park was a 15-minute walk away.

Clearly an event’s accessibility is going to affect who is going to want (or be able) to attend your event and it might not be obvious what someone’s ability might be.

You should look to make accessibility both in/ around and to/ from the event as painless possible -but it is also critical that you provide a point of contact for inquiries where extra help might be needed.

Establish session delivery rules

Firstly the event Code of Conduct should already make it clear to speakers to refrain from any inflammatory, derogatory, sexual, racist, or offensive comments or actions.

Furthermore, all speakers should adhere to a common framework of best practices for session delivery to ensure that a consistent and optimal experience is enjoyed by all. This is usually better being explicitly defined by an event.
Speakers can help people with audible impairments and deliver their session in a calm and clear manner trying their best not to mumble or rush (regardless of time). For people with visual impairments, the slide decks should avoid any color combinations that would give them problems (avoiding colour combinations that make it hard for colour blindness) and they should use large enough fonts and graphics. It should go without saying that all demos should be equally large enough for all to see.

Speakers should be mindful of attendees with mobility disabilities being able to move between rooms. They should aim to start their session on (or just after time) and wrap up well within the designated end time to provide as much time for an attendee to get to another room.

Organizers should ensure that there is plenty of time in between sessions and that session rooms have plenty of access between the chairs. Why not even go one step further and leave a front-row clear for wheelchairs? Why not leave a generous amount of space between chairs to make everyone feel a little more relaxed and comfortable during the presentation?

Publicise your event effectively

It can be very difficult to attract diversity at your event since often people from different backgrounds might not hang around in the same social or disadvantaged circles as yourself. You should be mindful of this and think outside the box. Attempt to contact group leaders in these other communities and ask them to promote your event to their attendees. Perhaps you can even offer to provide a financial incentive for every successful referral they manage to make? Every attendee has a small financial value to an event, and sponsors like to see new faces, so why not pass on a small amount of your sponsorship in this way? Communities supporting communities is really why we run these events.

Whatever you do to spread the message far and wide to potential future attendees, the most important thing you need to do is to promote your positive event message of diversity ensuring that all information is available (or easily accessible) from the front page of your event. You might only get one-shot to attract new faces who traditionally might avoid these kind of events so this is your opportunity to sell it to them.

Set up social and quiet spaces

Not everyone likes talking to complete strangers. For some people this comes easy, but for many (myself included) event break times are usually not something I particularly enjoy. Try to do your best to set up various activities in your social areas to make it easier for people to interact and encourage dialogue and participation (for instance and some of my past events we have set up large garden games (such as Giant Connect 4 and Giant Jenga) in the social spaces. Also aim to provide several quiet areas where people can go and sit down, be by themselves, and relax. Do not forget that some people might have religious or personal activities that they need to do during break times -perhaps they need to pray or take medication. At all of my recent events, I have made sure we have had at least 1 quiet room and 1 prayer room available at all times.

Provide accurate name badges

Name badges are a rather personal thing. Not everyone wants their twitter handle emblazoned across their chest, nor might they want any assumptions as to their gender, names, or other such nomenclature printed there. You should, therefore, give this thought and consider providing a display name type field on the event registration, making sure that the attendee is happy with anything else you might want to print about them.

Respect opt-outs

Probably one of the most frustrating aspects of attending an event is getting spammed. Whilst this is annoying to many, to those from diverse backgrounds, the thought of having their personal private details distributed to complete strangers is probably a step too far. If someone states that they want to opt-out of sponsor communications, then ensure their details are not passed onto anyone else. Clearly GDPR means you should be handling other people’s data with care already!


Having a diverse attendance at your event is not only great to share different ideas from many different viewpoints, but can also be attractive to sponsors of an event who are always wanting to cross-pollinate and promote into different communities. But reaching out to these diverse communities and attracting them to your event can be very difficult. Over time, word of mouth can help to promote your event far and wide, but you first need to lay the groundwork so that your event is a safe welcoming place to be and provides for people with diverse needs and requirements. Remember that attendee diversity can also be encouraged through attendees seeing that there is also diversity in your event organizer/ volunteer teams and speakers chosen for your event. In the last two parts of this series we will explore these things.

Azure subscription is not registered to use Cosmos DB namespace

It is usually the simplest things that often leave me feeling like I am a complete dummy. One such issue I ran into fairly recently when trying to deploy Cosmos DB into an Azure subscription.

From Azure DevOps I received the following error:

2019-05-31T16:28:55.4288261Z ##[error]MissingSubscriptionRegistration : The subscription is not registered to use namespace ‘Microsoft.DocumentDB’. See for how to register subscriptions.
2019-05-31T16:28:55.5005526Z ##[section]Finishing: Deploy Cosmos Account and Database with Shared Capacity

I initially assumed that the error was Azure DevOps related so I attempted to deploy using PowerShell and ran into an almost identical error.

I had deployed this Cosmos DB template successfully many times in our other subscriptions and could not understand why a simple deployment to an alternative subscription would fail. Looking back at the error message I followed the link provided which took me to a Microsoft doc titled Troubleshoot common Azure deployment errors with Azure Resource Manager and linked within I ended up on Resolve errors for resource provider registration.

It turns out that the Azure resource providers, which you can almost think of as Class libraries, can (like their programmatic counterparts) be in either Registered or NotRegistered state. When they are in a NotRegistered state, this means that we are unable to call that provider to create a specific resource (such as Cosmos DB in my case).

We can use PowerShell Az or the Azure CLI (both talked about elsewhere in this blog) to report what resources are available. In this specific example, I am going to return all providers that match the wildcard pattern of Microsoft.D*. The code searches for and sets the relevant subscription using Azure Cloud Shell (for simplicities sake), but you can do this through a remote Azure CLI or PowerShell Az session if you would prefer (and connectivity allows).

$subscription = Get-AzSubscription | Where-Object Name -Match "MySubscription1*"
Select-AzSubscription $subscription 
$providers = Get-AzResourceProvider -listavailable |Select-Object ProviderNamespace, RegistrationState
$providers  | Where-Object ProviderNamespace -Match "Microsoft.D*"

We get the following results:

ProviderNamespace               RegistrationState
-----------------               -----------------
Microsoft.DBforPostgreSQL       Registered
Microsoft.DevTestLab            Registered
Microsoft.Databricks            Registered
Microsoft.DataLakeStore         Registered
Microsoft.DataLakeAnalytics     Registered
Microsoft.DBforMySQL            Registered
Microsoft.DevSpaces             Registered
Microsoft.Devices               Registered
Microsoft.DataFactory           Registered
Microsoft.DataBox               NotRegistered
Microsoft.DataBoxEdge           NotRegistered
Microsoft.DataCatalog           NotRegistered
Microsoft.DataMigration         NotRegistered
Microsoft.DataShare             NotRegistered
Microsoft.DBforMariaDB          NotRegistered
Microsoft.DeploymentManager     NotRegistered
Microsoft.DesktopVirtualization NotRegistered
Microsoft.DevOps                NotRegistered
Microsoft.DigitalTwins          NotRegistered
Microsoft.DocumentDB            NotRegistered
Microsoft.DomainRegistration    NotRegistered

Notice that the Microsoft.DocumentDB namespace is disabled. If you are wondering, DocumentDB was the precursor name of the Cosmos DB SQL API (before Cosmos DB supported multiple APIs). Like many other Microsoft products, early names tend to stick with the products :).

To register this namespace we can simply run the following line of code against the subscription using the Register-AzResourceProvider cmdlet.

Register-AzResourceProvider -ProviderNamespace Microsoft.DocumentDB

The following output is returned:

ProviderNamespace : Microsoft.DocumentDB
RegistrationState : Registering
ResourceTypes     : {databaseAccounts, databaseAccountNames, operations, operationResults…}
Locations         : {Australia Central, Australia East, Australia Southeast, Canada Central…}

If it is not obvious you would unregister a provider namespace (if you wanted to make it unavailable) using the Unregister-AzResourceProvider cmdlet as follows:

UnRegister-AzResourceProvider -ProviderNamespace Microsoft.DocumentDB

Once I had registered the Microsoft.DocumentDB namespace, I was able to deploy my Cosmos DB template into my subscription without error!


Depending upon your subscription and region, your enabled provider namespaces may vary, however in my case someone had explicitly un-registered Microsoft.DocumentDB from it. You might ask why someone might do that? Well, it is a good way to prevent deployments of certain resource types if they go against your company policy.

As you can see, if you run into a similar problem or want to start using resource types that are by default NotRegistered you can register and start using them incredibly easily.