Creating Service Bus authorization rules with ARM errors out

Intro

In my current project we use Azure Resource Manager (ARM) templates to help with deployments across multiple subscriptions and environments. One of the elements of the ARM template is adding a couple of Shared Access Policies to enable Read and Write on the queues we have in place. The policies have been defined on Service Bus level because they span multiple queues.

Our ARM template functioned just fine, (automated) deployment was up & running and life was beautiful. Until our automated deployment to our development environment triggered in the night of January 24th. Our ARM template, not having been changed for a while, suddenly errored out with a Bad Request. The message read:

Request payload is not in the expected format.

Searching for the issue

We checked everything: API versions (still version 2015-08-01, so no changes there), variables we introduced (no changes there) and parameters. We even stripped out all dynamic behavior just to be sure that wasn’t the cause. And it wasn’t.

The offending part of the ARM template (the one that had functioned before) looked like this:
{
    "apiVersion": "2015-08-01",
    "name": "[concat(variables('servicebus_namespace_name'), '/', 'RoleName')]",
    "type": "Microsoft.ServiceBus/namespaces/authorizationRules",
    "dependsOn": [
"[concat('Microsoft.ServiceBus/namespaces/', variables('servicebus_namespace_name'))]"
     ],
    "location": "[variables('location')]",
    "properties": {
        "Rights": [
            //"Send",
            "Listen"
            //"Manage"
]
}
}

I found an article Create a Service Bus authorization rule for namespace and queue using an Azure Resource Manager template. One of the things in that article is an exmple, that also holds a piece of template to create an Authorization Rule on Service Bus level:

{
    "apiVersion": "[variables('sbVersion')]",
    "name": "[variables('namespaceAuthRuleName')]",
    "type": "Microsoft.ServiceBus/namespaces/authorizationRules",
    "dependsOn": ["[concat('Microsoft.ServiceBus/namespaces/', parameters('serviceBusNamespaceName'))]"],
    "location": "[resourceGroup().location]",
    "properties": {
        "Rights": ["Send"]
}
}

I put the two parts next to each other and started removing all differences between the two. Spacing, newlines… I made sure everything matched. And what do you know? The damned thing worked.

Several tries (and failures) later, I now know what caused our ARM template to fail. It were the comments in the Rights element.

Solution

In the end, the only thing I had to do to get our template working again was remove the comments in the Rights element. I did try with several different comments (with and without a comma in there, for instance) but the comments I tried all made the template fail. As said earlier, the template worked earlier, including the comments. The fact that there are comments all over the place in our ARM template makes it even stranger…

Hope this helps.

Fixing the Remote Desktop Connection to a Virtual Machine in Microsoft Azure

A few minutes before my second session at the Dutch Techdays started I tried connecting to my Virtual Machine in Microsoft Azure through remote desktop. It didn’t connect… The RDP client tried to connect to the Virtual Machine, but nothing happened.

So I rebooted the VM and tried connecting again, confident that this would solve the problem. It didn’t connect…. again. As I started stressing out a bit (the VM was the main character of my session) I thought of one last thing I could try.

Fixing the issue

The next steps helped me save my Virtual Machine without too much loss of time (I was able to connect again just before the start of my session!):

  • Go to the Azure Management Portal
  • Open up the details of the VM you’re having trouble with
  • Go to the ENDPOINTS tab (see image below)
  • Select the ‘Remote Desktop’ endpoint and click EDIT at the bottom of the screen
  • Change the public port to a different (random) number
  • Wait for the changes to be propagated
  • Success!

Azure Management Portal

Hope this helps.

Techdays 2014 The Netherlands

As I wrote earlier I presented at the 2014 Dutch Techdays. The session content is now available online. Find it here (Dutch):

Techdays14_Logo_1channel-9-logo

Speaking at TechDays 2014

Techdays14_Logo_1I’m proud to announce that this year I’ll be speaking at the TechDays in the World Forum in Den Haag, April 16 – 17. This session will be about High Performance Computing in Windows Azure.

Camera resolutions keep increasing, your digital behavior on websites and in apps is collected, images that satellites make get more and more detailed and (research) equipment produces more data. The amount of data that’s being stored keeps increasing. This data often has to be processed to become information. With increasing amounts of data to be processed the need for a Cluster like solution to achieve this within acceptable time grows. With the rise of the Cloud you don’t need to have that Cluster in the basement anymore, but you can leverage the power and capacity of the Cloud. In this session you see how High Performance Computing in Windows Azure can be used to distribute processing tasks to multiple machines in Windows Azure.

Error installing the Windows Azure AppFabric Tools for Visual Studio (CTP)

Windows Server AppFabric is installed and is not compatible with this release of Windows Azure AppFabric Developer Tools for Microsoft Visual Studio 2010 - June 2011 CTP. Please uninstall Windows Server AppFabric and rerun this setup if you want to install Windows Azure AppFabric Developer Tools for Microsoft Visual Studio 2010 - June 2011 CTP.When installing the Windows Azure AppFabric Tools for Visual Studio (found here), you might get the error message shown on the right, stating that Windows Server AppFabric is installed and that it is not compatible with this release of Windows Azure AppFabric Developer Tools for Microsoft Visual Studio 2010 – June 2011 CTP. It asks to uninstall Windows Server AppFabric and rerun this setup if you want to install Windows Azure AppFabric Developer Tools for Microsoft Visual Studio 2010 – June 2011 CTP.

When looking for the install of ‘Windows Server AppFabric’ to remove it through ‘Uninstall a program’ you won’t find this item in the list of installed programs. This might feel as a big problem heading your way…

Solution
This is, however, only a small problem on your way to Azure AppFabric development. Go to your list of installed programs and click ‘View installed updates’. Under Windows, you will find the update ‘Windows Server AppFabric (KB970622)’. Uninstall the update, restart your machine and try installing the Windows Azure AppFabric Tools for Visual Studio again…

Enjoy!