How to publish a VM in Azure

Publishing a VM in Azure is not as easy or simple as we had hoped. After much back and forth between marketing people, DevOps and a couple of our developers we finally got it right! The biggest component we never factored in was just how long it would take from start to finish. Microsoft has to certify (understandably) every step and change along the way to make sure that the quality of the offers in their marketplace is top notch. But this means that there are a lot of hoops to jump through to finally get your little (big) nod of approval to publish your hard work in their store. It’s totally worth it though, having your platform available in the cloud is definitely a must. Enough of this talk, let’s get to the good stuff.¹

Creating your virtual machine

First, you need to get 2 things in motion. You should already have a Microsoft account, so next setup the following:

So now we need to get into Azure.

  1. Got to https://publish.windowsazure.com and enter your Microsoft account details
  2. Click on the Publish a VIRTUAL MACHINEWarewolf VM in Microsoft Azure
  3. Give your virtual machine a Title
  4. Click Create new VM Marketplace Offer
  5. You should be taken to a screen like this. We need to start from step 3 (assuming Step 1 and 2 are covered as above): Warewolf VM offer in MS Azure
  6. I personally found it easier to use the left hand menu to navigate and work through each step: VM walkthrough in MS Azure

 

Setting up your VM in Azure: SKUS

  1. Add at least one SKU
  2. Choose whether to offer a free trial or not
  3. Decide how much it should cost

VM Images

  1. First provision a new VM in Azure. Either by creating a fresh new VM from the Azure store or mounting an existing VM image
  2. Start and connect to your VM
  3. Write a script and put it on the drive of the virtual machine which will download and install the latest version of your product automatically. In PowerShell the script for initializing a new VM looks like:
$warewolf_amazon_url = {Some URL to Warewolf’s installer download}
$version_url = {Some URL to download the latest version text of Warewolf}
$client.DownloadFile($version_url, $version_filename)
$client = new-object System.Net.WebClient
# Read the version file into a variable and build the latest EXE installer filename
$version = [IO.File]::ReadAllText($version_filename);
$warewolf_filename =  $setup_folder + "Warewolf-" + $version + ".exe"
$FullUrl = $warewolf_amazon_url + "Warewolf-" + $version + ".exe"
# Download the EXE installer
Write-Host "Download Warewolf $version started..." ;
$client.DownloadFile($FullUrl, $warewolf_filename)     
if(-not (Test-Path $warewolf_filename -PathType Leaf) -eq 0)
{
   Write-Host "Download Warewolf $version completed." ;
    # Run the EXE
    Write-Host "Setup Warewolf $version started..." ;
    $arguments ='-s'
    $installerProcess = Start-Process -FilePath $warewolf_filename -ArgumentList>
    $arguments –Passthru
}
  1. Add a scheduled task using the task scheduler in the control panel to run the script on first login
  2. Once you are satisfied that your script works and that any new user who logs into your VM for the first time (after they’ve waited for your script to execute) will be able to use the latest version of your product
  3. SysPrep the VM and have SysPrep restart the machine
  4. Check that your script works and see what the user’s experience will be when they start your VM for the first time
  5. Make any changes you need to the script to improve user’s first time experience with your VM
  6. Run SysPrep again but this time have SysPrep leave the machine shut down
  7. Create a VM image by clicking on the Capture button in Azure:warewolf vm sandbox in azure

Take note of the storage account you saved the image to.

  1. Get the storage account credentials for that storage account by clicking the Keys button in Azure: warewolf microservices in azure
  2. Download storage explorer
  3. Log in with the storage account keys you got in Step 11
  4. Navigate to your captured VM image and select it in storage explorer
  5. Click Security in the left hand side menu: security in windows azure
  6. In the Shared Access Signatures tab. The List and Read checkboxes should be the only ones ticked and the dates needs to allow access for three days after this entire SKU is published. So ensure you give plenty of time to get through the next few parts of this guide
  7. Click Generate. You should get a url that looks like http://(STORAGE CONTAINER NAME).blob.core.windows.net/(PATH ON AZURE)/(VM FILENAME).vhd?sv=2014-02-14&sr=c&sig=(ACCESS KEY)&st=(YESTERDAY’S DATE)&se=(THREE DAYS AFTER SKU PUBLISH)&sp=rl
  8. Note the sr=c and sp=rl parts, those are necessary and you will fail to publish without them.
  9. Go back to https://publish.windowsazure.com and select VM Images under Virtual Machines from the menu on the left:Virtual machine images in Azure
  10. Copy paste the URL from step 17 into the VIRTUAL MACHINE IMAGES section.
  11. Fill in the rest of the form.
  12. Click the Save icon in the top right.

Marketing

This section is where you need your copywriter/marketing person to come in. There is quite a lot of content needed here, like descriptions and images.

  1. Click the Marketing link
  2. Create an Identifier. Remember this should be something descriptive and SEO friendly, as users will use this to search for and find your VM.
  3. In the Languages section below the Identifier, click English (US)
  4. Here you need to add the Title, Summary, Long Summary and HTML Description. You also need to add a range of logo and image options in different sizes. Read this page about image guidelines for the Azure Marketplace.
  5. Using the left hand menu, navigate through the Links, Sample Images, Plans and Legal sections and fill in all your relevant information Virtual machine details for marketing

Pricing

There are different ways to price your offer and it depends on your currency and country. Our prices are based in USD and we wanted to Autoprice everything based on that. This is a bit of a tedious process as you will need to define the exchange rate you want to use for each country – the auto suggested rates are very out of date. Something to note, at this point in time you cannot change or update the pricing on your VM once it has been published. I really hope this feature comes soon as right now we have to have fixed prices at a fixed rate for all eternity.

  1. Click the Pricing link in the left hand menu
  2. Select the country you want to use for your base for all other pricing to pull from
  3. Fill in all the pricing information for the different plans you have.
  4. At the bottom of the page click Autoprice other markets based on (country you selected)
  5. Choose the plans and meters you want to price and click the forward arrow
  6. Choose the markets you want to price and click the forward arrow
  7. This is the fun part (note the sarcasm)!  I recommend going through each exchange rate to select the rate you want to use. As mentioned above, the rates supplied here are out of date and very inaccurate. Fill these in and select the tick to continue
  8. Have a mini celebration! You deserve a cupcake.

Support

Microsoft requires you to have a telephonic and online/helpdesk support option for your users. Make sure you have all your details on hand for this section.

  1. Click the Support button in the left hand menu
  2. Fill in the Engineering Contact and Customer Support details
  3. Click the little save icon at the top right 

Categories

You can choose up to five categories for the Azure Marketplace Gallery.

  1. Click the Categories button in the left hand menu
  2. Select the categories that your offer fulfills Select the categories that fit your virtual machine offer
  3. Click save

 

Publish – getting your VM into the Azure Marketplace

You are now ready to push your offer into staging! This is a compulsory step before publishing. Offers staged in the Azure Marketplace are only visible to specific Azure subscriptions. Make sure you have the which Azure Subscriptions IDs that you want to grant access your offer.

  1. Click the Publish button in the left hand menu
  2. Click the Push to staging button under the Staging section
  3. Add the Azure Subscription ID and click the little plus icon
  4. Click the tick button to push your offer into staging. This may take 1-2 days before you can access it. You will not get any notification, so keep checking in the Publish Section

Once your offer has been staged, and you are happy with it, then you are ready to Publish. Again this may take a few days and you will need to keep checking in.

  1. Under the Production section click Request approval to push to production
  2. Once your offer has been approved, you will see it as Listed in the status section
  3. Click the Microsoft Azure Gallery listing link to search for your offer
  4. Congratulations! Your offer is now in the Azure Marketplace.

Warewolf VM in Azure Marketplace ¹ This information is correct at the time of this post being published. We accept no responsibility for any change to this process or undesirable outcomes.

FacebookTwitterLinkedInGoogle+RedditEmail

Leave A Comment?