Archive | November, 2016

AZURE ARM template deployment

30 Nov

 

Issue:

When you are developing ARM templates in Visual studio and want to deploy you will get an error:

[ERROR] The running command stopped because the preference variable “ErrorActionPreference” or common parameter is set to Stop: Container name ‘dev_mka_extentiontest-stageartifacts’ is invalid. Valid names start and end with a lower case letter or a number and has in between a lower case letter, number or dash with no consecutive dashes and is 3 through 63 characters long.

[ERROR] + CategoryInfo : InvalidArgument: (:) [Set-AzureStorageBlobContent], ArgumentException

[ERROR] + FullyQualifiedErrorId : ArgumentException,Microsoft.WindowsAzure.Commands.Storage.Blob.SetAzureBlobContentCommand

 

Investigation

Reading the error message it should be something with the name of the artifacts container the deployment script wants to create.

I use the deployment configured as below:

So I just took the Azure storage explorer and tried to create exactly the same container. And guess … same error.

So I changed the _ in the name to – and guess … it worked.

Solution:

So be sure you don’t create a Resource group with_ in the name. Yes I know Azure will accept it but the deployment script used in Visual studio has an issue with this.

 

 

Happy Azurering

Michel kamp

https://michelkamp.wordpress.com

Azure Marketplace Solution UI Test

29 Nov

Hi,

A quick note for all DevOps under us:

Currently I am doing an investigation on how to publish a solution to the Azure marketplace. You have 2 ways to do this. A Virtual Machine offer or a Solution template offer.

A Virtual Machine offer will be a sysprep’d VM that will contain all your pre-installed software and just will be deployed as a new virtual machine. So you will have to prepare a VM and sysprep/generalize it and upload it to Azure.

A Solution template offer is somehow more advanced. Here you don’t have to configure a sysprep’d VM image but you just use an ARM template to rollout a brand new VM and then use a script extension resource to deploy your artifacts (aka your software to install). The cool part is that you can also change the UI interface on the Azure portal when configuring the deployment. This is done with the createUiDefinition.json file that has to be a part of the solution zip file you upload to azure.

An example of this can be found here: https://github.com/Azure/azure-quickstart-templates/tree/master/marketplace-samples

So when you have created all your ARM templates and put it into a Solution zip file (aka just zip all the ARM templates in one file) you will upload it using the https://publish.windowsazure.com portal and make a staged publish. (aka test rollout/publish)

Now you have to wait for a couple of hours before it will be ready to test it out. And this is the part that is annoying. There is no way to test the custom UI interface without having to do a staged publish and wait for a couple of hours a again……

Or is there …. ??

Yes there is! Thanks to this link I was able to test my custom deployment UI.

All you will have to do is:

  1. Create using the Azure storage explorer a new public container. (so set the public access level). For example named : “test”
  2. Copy the file “createUiDefinition.json” to this container.
  3. Check if you can open the file using the “copy Url” in a new browser.
  4. Now you will have to encode this URL , you can use http://meyerweb.com/eric/tools/dencoder/ for this.
  5. The URL looks like this now: https%3A%2F%2Fegnlmkotkizce.blob.core.windows.net%2Ftest%2FcreateUiDefinition.json
  6. Now replace the URL in the text below: (note: if you see ” replace it by the normal double quotes , this is a WordPress issue)

    https://portal.azure.com/#blade/Microsoft_Azure_Compute/CreateMultiVmWizardBlade/internal_bladeCallId/anything/internal_bladeCallerParams/{“initialData”:{},”providerConfig”:{“createUiDefinition”:”URL from step 5“}}

     

  7. The end result could look like this:

    https://portal.azure.com/#blade/Microsoft_Azure_Compute/CreateMultiVmWizardBlade/internal_bladeCallId/anything/internal_bladeCallerParams/{“initialData”:{},”providerConfig”:{“createUiDefinition”:”https%3A%2F%2Fegnlmkotkizce.blob.core.windows.net%2Ftest%2FcreateUiDefinition.json“}}

     

  8. Open a new browser and paste in the URL from step 7. And the result will be ….

 

Super handy and cool!

 

Happy scomming azuring

Michel Kamp

https://michelkamp.wordpress.com