Download marketplace items from Azure to Azure Stack

Applies to: Azure Stack integrated systems and Azure Stack Development Kit

As a cloud operator, download items from the Azure Marketplace and make them available in Azure Stack. The items you can choose are from a curated list of Azure Marketplace items that are pre-tested and supported to work with Azure Stack. Additional items are frequently added to this list, so continue to check back for new content.

There are two scenarios for connecting to the Azure Marketplace:

  • A connected scenario - that requires your Azure Stack environment to be connected to the internet. You use the Azure Stack portal to locate and download items.
  • A disconnected or partially connected scenario - that requires you to access the internet using the marketplace syndication tool to download marketplace items. Then, you transfer your downloads to your disconnected Azure Stack installation. This scenario uses PowerShell.

See Azure Marketplace items for Azure Stack for a list of the marketplace items you can download.

Connected scenario

If Azure Stack connects to the internet, you can use the admin portal to download marketplace items.

Prerequisites

Your Azure Stack deployment must have internet connectivity, and be registered with Azure.

Use the portal to download marketplace items

  1. Sign in to the Azure Stack administrator portal.

  2. Review the available storage space before downloading marketplace items. Later, when you select items for download, you can compare the download size to your available storage capacity. If capacity is limited, consider options for managing available space.

    To review available space, in Region management select the region you want to explore, and then go to Resource Providers > Storage.

    Review storage space

  3. Open the Azure Stack Marketplace and connect to Azure. To do so, select Marketplace management, and then select Add from Azure.

    Add from Azure

    The portal displays the list of items available for download from the Azure Marketplace. You can click on each item to view its description and additional information about it, including its download size.

    Marketplace list

  4. Select the item you want, and then select Download. Download times vary.

    Download message

    After the download completes, you can deploy the new marketplace item as either an Azure Stack operator or user.

  5. To deploy the downloaded item, select +New, and then search among the categories for the new marketplace item. Next select the item to begin the deployment process. The process varies for different marketplace items.

Disconnected or a partially connected scenario

If Azure Stack is in a disconnected mode and without internet connectivity, you use PowerShell and the marketplace syndication tool to download the marketplace items to a machine with internet connectivity. You then transfer the items to your Azure Stack environment. In a disconnected environment, you can’t download marketplace items by using the Azure Stack portal.

The marketplace syndication tool can also be used in a connected scenario.

There are two parts to this scenario:

  • Part 1: Download from Azure Marketplace. On the computer with internet access you configure PowerShell, download the syndication tool, and then download items form the Azure Marketplace.
  • Part 2: Upload and publish to the Azure Stack Marketplace. You move the files you downloaded to your Azure Stack environment, import them to Azure Stack, and then publish them to the Azure Stack Marketplace.

Prerequisites

Use the marketplace syndication tool to download marketplace items

  1. On a computer with an Internet connection, open a PowerShell console as an administrator.

  2. Add the Azure account that you have used to register Azure Stack. To add the account, in PowerShell run Add-AzureRmAccount without any parameters. You are prompted to enter your Azure account credentials and you might have to use 2-factor authentication based on your account’s configuration.

  3. If you have multiple subscriptions, run the following command to select the one you have used for registration:

    Get-AzureRmSubscription -SubscriptionID '<Your Azure Subscription GUID>' | Select-AzureRmSubscription
    $AzureContext = Get-AzureRmContext
    
  4. Download the latest version of the marketplace syndication tool by using the following script:

    # Download the tools archive.
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
    invoke-webrequest https://github.com/Azure/AzureStack-Tools/archive/master.zip `
      -OutFile master.zip
    
    # Expand the downloaded files.
    expand-archive master.zip `
      -DestinationPath . `
      -Force
    
    # Change to the tools directory.
    cd .\AzureStack-Tools-master
    
  5. Import the syndication module and then launch the tool by running the following script. Replace the destination folder path with a location to store the files you download from the Azure Marketplace.

    Import-Module .\Syndication\AzureStack.MarketplaceSyndication.psm1
    
    Sync-AzSOfflineMarketplaceItem `
      -destination "Destination folder path" `
      -AzureTenantID $AzureContext.Tenant.TenantId `
      -AzureSubscriptionId $AzureContext.Subscription.Id  
    
  6. When the tool runs, you are prompted to enter your Azure account credentials. Sign in to the Azure account that you have used to register Azure Stack. After the login succeeds, you should see a screen like the following image, with the list of available marketplace items.

    Azure Marketplace items popup

  7. Select the item that you want to download and make a note of the version. (You can select multiple images by holding the Ctrl key.) You will reference the version when you import the item in the next procedure.

    You can also filter the list of images by using the Add criteria option.

  8. Select OK, and then review and accept the legal terms.

  9. The time that the download takes depends on the size of the item. After the download completes, the item is available in the folder that you specified in the script. The download includes a VHD file (for virtual machines) or a .ZIP file (for virtual machine extensions). It also includes a gallery package in the .azpkg format. (A .azpkg package is a .zip file.)

Import the download and publish to Azure Stack Marketplace

  1. The files for virtual machine images or solution templates that you have previously downloaded must be made locally available to your Azure Stack environment.

  2. Import .VHD files to Azure Stack. To successfully import a virtual machine (VM) image, you must have the following information about the VM:

    • The version, as noted in step 7 of the preceding procedure.
    • The values for the VMs publisher, offer, and sku. To get these values, rename a copy of the .azpkg file to change its file extension to .zip. You can then use a text editor to open DeploymentTemplates\CreateUiDefinition.json. In the .json file, locate the imageReference section, which contains these values for the marketplace item. The following example demonstrates how this information appears:

      "imageReference": {  
         "publisher": "MicrosoftWindowsServer",  
         "offer": "WindowsServer",  
         "sku": "2016-Datacenter-Server-Core"  
       }
      

    Import the image to Azure Stack by using the Add-AzsPlatformimage cmdlet. When using this cmdlet, make sure to replace the publisher, offer, and other parameter values with the values of the image that you are importing. You can get the publisher, offer, and sku values of the image from the text file that is downloaded together with the AZPKG file and stored in the destination location.

    In the following example script, values for the Windows Server 2016 Datacenter - Server Core virtual machine are used.

    Add-AzsPlatformimage `
     -publisher "MicrosoftWindowsServer" `
     -offer "WindowsServer" `
     -sku "2016-Datacenter-Server-Core" `
     -osType Windows `
     -Version "2016.127.20171215" `
     -OsDiskLocalPath "C:\AzureStack-Tools-master\Syndication\Windows-Server-2016-DatacenterCore-20171215-en.us-127GB.vhd" `
    

    About solution templates: Some templates can include a small 3 MB .VHD file with the name fixed3.vhd. You don't need to import that file to Azure Stack. Fixed3.vhd. This file is included with some solution templates to meet publishing requirements for the Azure Marketplace.

    Review the templates description and download and then import additional requirements like VHDs that are required to work with the solution template.

  3. Use the admin portal to upload the marketplace item package (the .azpkg file) to Azure Stack Blob storage. Upload of the package makes it available to Azure Stack so you can later publish the item the Azure Stack Marketplace.

    Upload requires you to have a storage account with a publicly accessible container (see the prerequisites for this scenario)

    1. In the Azure Stack admin portal, go to More services > Storage accounts.

    2. Select a storage account from your subscription, and then under BLOB SERVICE, select Containers.
      Blob service

    3. Select the container you want to use and then select Upload to open the Upload blob pane.
      Container

    4. On the Upload blob pane, browse to the files that you want to load into storage and then select Upload.
      upload

    5. Files that you upload appear in the container pane. Select a file and then copy the URL from the Blob properties pane. You'll use this URL in the next step when you import the marketplace item to Azure Stack. In the following image, the container is blob-test-storage and the file is Microsoft.WindowsServer2016DatacenterServerCore-ARM.1.0.801.azpkg. The file URL is https://testblobstorage1.blob.local.azurestack.external/blob-test-storage/Microsoft.WindowsServer2016DatacenterServerCore-ARM.1.0.801.azpkg.
      Blob properties

  4. Use PowerShell to publish the marketplace item to Azure Stack by using the Add-AzsGalleryItem cmdlet. For example:

    Add-AzsGalleryItem `
     -GalleryItemUri "https://mystorageaccount.blob.local.azurestack.external/cont1/Microsoft.WindowsServer2016DatacenterServerCore-ARM.1.0.801.azpkg" `
     –Verbose
    
  5. After you publish a gallery item, you can view it from More services > Marketplace. If your download is a solution template, make sure you add any dependent VHD image for that solution template.
    View marketplace

Note

With the release of Azure Stack PowerShell 1.3.0 you can now add Virtual Machine Extensions.

For example:

Add-AzsVMExtension -Publisher "Microsoft" -Type "MicroExtension" -Version "0.1.0" -ComputeRole "IaaS" -SourceBlob "https://github.com/Microsoft/PowerShell-DSC-for-Linux/archive/v1.1.1-294.zip" -SupportMultipleExtensions -VmOsType "Linux"

Next steps

Create and publish a Marketplace item