AzureStack : How to create my first Market Place Item

Today we will focus on how to create our first Market Place Item for AzureStack.
The Microsoft Official documentation is available here: https://azure.microsoft.com/en-us/documentation/articles/azure-stack-marketplace/

At the end of this post, you will be able to download a working example.

1. Create a new ARM template or pick one from Github (https://github.com/Azure/AzureStack-QuickStart-Templates) In this guide, I will use the following ARM Template: https://raw.githubusercontent.com/Azure/AzureStack-QuickStart-Templates/master/101-simple-windows-vm/azuredeploy.json

2. Test the template in your Microsoft Azure Stack infrastructure to ensure that the resource can be deployed successfully.

3. Create a working folder (Example: C:\MyMarketPlaceItem).

4. In your working folder, save your template into a text file with the .json extension.clip_image002

5. Create a new empty file named manifest.json, copy/paste the following content and save it to your working folder.

{
    "$schema": "https://gallery.azure.com/schemas/2014-09-01/manifest.json#",
    "name": "MyMarketPlaceItem", // [A-Za-z0-9]+
    "publisher": "vNextLab", // [A-Za-z0-9]+
    "version": "1.0.1", // SemVer v2 Format - see http://semver.org/
    "displayName": "My first Market Place Item", // max of 256 characters / recommendation 80 characters
    "publisherDisplayName": "vNextLab", // max of 256 characters  / recommendation 30 characters
    "publisherLegalName": "VNEXT SPRL", // max of 256 characters 
    "summary": "this is my first market place itemthis is my first market item, this is my first market item", // 60 to 100 characters -->
    "longSummary": "Long Summary of my first market place itemLong Summary of my first market place itemLong Summary of my first market place itemLong Summary of my first market place item", // 140 to 256 characters
    "description": "Description of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place itemDescription of my first market place item", // 5000 to 50000 characters. Can contain HTML
    "properties": [
        /* optional. max of 10 properties
           displayName: max of 64 characters
           value: max of 64 characters */
        { "displayName": "Properties 1", "value": "Value1" }
    ],
    "uiDefinition": {
        "path": "UIDefinition.json" // required, path to file
    },
    "artifacts": [
        // you probably want an artifact, because this is where the link to your ARM deployment template goes!
        /* name: max of 256 characters, [A-Za-z0-9\-_]+
           type: Fragment, Template
           path: path to artifact
           isDefault: true|false */
      {
        "name": "AzureDeploy101VM",
        "type": "Template",
        "path": "azuredeploy.json",
        "isDefault": true } 
    ],
  "icons": {
    "small": "Images\\Small.png", // 40x40
    "medium": "Images\\Medium.png", // 90x90
    "large": "Images\\Large.png", // 115x115
    "wide": "Images\\Wide.png", // 255x115 Not supported in Azure Stack UI
    "hero": "Images\\hero.png" // 815x290 Not supported in Azure Stack UI
  },
    "links": [
        /* optional, but highly recommended, max of 10 links
           displayName: max of 64 characters
           uri: uri */
        { "displayName": "vNextLab", "uri": "https://www.vnext.be" }
    ],
    "screenshots": [ "Images\\Screenshot1.png" ], // 533x324
    "categories": [ "Compute" ] // Compute, Data + Storage,...
}

 

6. Modify the content to match with your package information.

7. Create a new empty file named UIDefinition.json, copy/paste the following content and save it into your working folder.

{
    "$schema": "https://gallery.azure.com/schemas/2015-02-12/UIDefinition.json#",
    "createDefinition": {
        "createBlade": {
            "name": "DeployFromTemplateBlade",
            "extension": "HubsExtension"
        }
    }
}

 

8. You have now 3 .json files in your working folder.clip_image004

9. In this folder, create a new folder named Images and created the 6 following images files.

NAME

WIDTH

HEIGHT

NOTES

Hero

815px

290px

Not yet applicable in Azure Stack

Wide

255px

115px

Not yet applicable in Azure Stack

Large

115px

115px

Always required.

Medium

90px

90px

Always required.

Small

40px

40px

Always required.

Screenshot(s)

533px

324px

Optional.

10. Your images folder should be similar to this: The T in the middle of my image is for “Temporary”
clip_image006

11. Download the Azure Gallery Packaging Tool: http://www.aka.ms/azurestackmarketplaceitem

12. Extract the files
clip_image008

13. Copy the folder AzureGalleryPackageGenerator to your C:\ drive
clip_image010

14. Start a new Command Prompt as administrator, go to the folder AzureGalleryPackageGenerator and run the following command:
AzureGalleryPackager.exe package -m C:\MyMarketPlaceItem\manifest.json -o C:\MyMarketPlaceItem
clip_image012

15. Confirm that an AZPKG file has been created in your working folder.
clip_image014

16. Open PowerShell ISE and copy/paste the following script.

########################
#Parameters
########################
import-module  AzureRm.AzureStackAdmin #First install D:\Dependencies\azure-powershell.msi from the ClientVM

#Provide your Azure Active Direcoty Admin account
[net.mail.mailaddress]$AadFullMailAddress="mas@vnextlab.be"

#Path to the Azure package your created
$PackagePath = "C:\MyMarketPlaceItem\vNextLab.MyMarketPlaceItem.1.0.1.azpkg"

#The script will create a new Resource Group to store your Market Place Item
$resourceGroupName = "MarketPlaceItems"

########################
#Script
########################
#Extract the package Name
$PackageName = (Get-Item $PackagePath).Name -replace '.azpkg',''

#Get the Azure AD GUID (Credit Menno Stevens)
$AadTenantId=(Invoke-WebRequest -Uri ('https://login.windows.net/'+($AadFullMailAddress.Host)+'/.well-known/openid-configuration')|ConvertFrom-Json).token_endpoint.Split('/')[3]

#Connection with your MAS Service Admin Credentials
Add-AzureRmEnvironment -Name 'Azure Stack' `
    -ActiveDirectoryEndpoint ("https://login.windows.net/$AadTenantId/") `
    -ActiveDirectoryServiceEndpointResourceId "https://azurestack.local-api/" `
    -ResourceManagerEndpoint ("https://api.azurestack.local/") `
    -GalleryEndpoint ("https://gallery.azurestack.local:30016/") `
    -GraphEndpoint "https://graph.windows.net/"
 
# Get Azure Stack Environment Information
$env = Get-AzureRmEnvironment 'Azure Stack'

# Authenticate to AAD with Azure Stack Environment
Add-AzureRmAccount -Environment $env -Verbose

# Get Azure Stack Environment Subscription
$Subscription = Get-AzureRmSubscription -SubscriptionName "Default Provider Subscription"  | Select-AzureRmSubscription
$SubscriptionID = $Subscription.Subscription.SubscriptionId

#Create the Resource Group
New-AzureRmResourceGroup -Name $resourceGroupName -Location local

#Adding the package to the Market Place
Add-AzureRMGalleryItem -SubscriptionId $SubscriptionID -ResourceGroup $resourceGroupName -Name $PackageName -Path $PackagePath  -Apiversion "2015-04-01" –Verbose

 

17. Modify the parameters to match with your package and MAS info.

18. Start Internet Explorer and add the following websites in the Trust Sites
*.microsoft.
*.microsoftonline.com
*.microsoftonline-p.com
clip_image016

19. Run the script in PowerShell ISE.

20. Provide your MAS Service Admin credentials when prompted and click on Sign In.
clip_image018

21. The script should give you the following output.
clip_image020

22. Connect to the MAS portal (As Service Admin or Tenant), go to New, Compute and you should see your new Market Place Item.
clip_image022

23. You could also browse the complete Market Place to see the details of your Package.
clip_image024

You could download the example here: https://www.vnext.be/wp-content/uploads/2016/02/MyMarketPlaceItem.zip

Cheers
Christopher

Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Email this to someoneShare on TumblrPin on PinterestDigg thisShare on RedditFlattr the authorBuffer this pageShare on StumbleUpon

About Christopher Keyaert

Christopher Keyaert is a Consultant, focused on helping partners to leverage the System Center and Microsoft Azure cloud platform. He is also a Microsoft Most Valuable Professional (MVP) for Cloud and Data Center Management and a Microsoft Certified Trainer (MCT).
This entry was posted in AzureStack. Bookmark the permalink.

One Response to AzureStack : How to create my first Market Place Item

  1. Tim says:

    Hello,

    When connecting to Azure Stack PowerShell i get the following error. Any idea on how to fix? I have tried 2 seperate installations. Thanks in advance!

    Add-AzureRmAccount : AADSTS50001: The application named https://azurestack.local-api/ was not found in the tenant named 30045722-3388-450f-b067-23a307460e04. This can
    happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication
    request to the wrong tenant.

Leave a Reply

Your email address will not be published. Required fields are marked *