將 Marketplace 項目下載到 Azure Stack HubDownload Marketplace items to Azure Stack Hub

雲端操作者可從 Marketplace 將項目下載 Azure Stack Hub,並讓這些項目可供所有使用 Azure Stack Hub 環境的使用者使用。As a cloud operator, you can download items to Azure Stack Hub from the Marketplace and make them available to all users using the Azure Stack Hub environment. 您可以選擇的項目來自 Azure Marketplace 項目策劃清單,這些項目已預先測試並支援搭配 Azure Stack Hub 運作。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 Hub. 其他項目會不斷新增到此清單中,因此請繼續回來查看是否有新內容。Additional items are frequently added to this list, so continue to check back for new content.

有兩種下載 Marketplace 產品的案例:There are two scenarios for downloading Marketplace products:

  • 已中斷連線或部分連線的案例:您必須存取網際網路,才能使用 Marketplace 摘要整合工具下載 Marketplace 項目。Disconnected or partially connected scenario: Requires you to access the internet using the Marketplace syndication tool to download Marketplace items. 然後,將下載項目傳輸到已中斷連線的 Azure Stack Hub 安裝。Then, you transfer your downloads to your disconnected Azure Stack Hub installation. 此案例使用 PowerShell。This scenario uses PowerShell.
  • 已連線的案例:Azure Stack Hub 環境必須連線到網際網路。Connected scenario: Requires your Azure Stack Hub environment to be connected to the internet. 您可使用 Azure Stack Hub 系統管理員入口網站來找出並下載項目。You use the Azure Stack Hub administrator portal to locate and download items.

請參閱適用於 Azure Stack Hub 的 Azure Marketplace 項目,以取得您可以下載的市集項目完整清單。See Azure Marketplace items for Azure Stack Hub for a complete list of the marketplace items you can download. 如需 Azure Stack Hub Marketplace 最近新增、刪除和更新的清單,請參閱 Azure Stack Hub Marketplace 變更一文。See the Azure Stack Hub Marketplace changes article for a list of recent additions, deletions, and updates to Azure Stack Hub Marketplace.

注意

目錄會根據 Azure Stack Hub 系統所連線的雲端而有所不同。The catalog will be different based on the cloud your Azure Stack Hub system is connected to. 雲端環境取決於您用來註冊 Azure Stack Hub 的 Azure 訂用帳戶。The cloud environment is determined by the Azure subscription you use for registering your Azure Stack Hub.

注意

您也可以使用「操作員存取工作站」 (OAW) 存取具特殊許可權的端點 (PEP) 、適用于支援案例的系統管理員入口網站,以及 Azure Stack Hub GitHub 工具。You can also use the The Operator Access Workstation (OAW) to access the privileged endpoint (PEP), the Administrator portal for support scenarios, and Azure Stack Hub GitHub Tools. 如需詳細資訊,請參閱 Azure Stack Hub 操作員存取工作站For more information see Azure Stack Hub Operator Access Workstation.

已連線的部署可讓您使用系統管理員入口網站來下載市集項目。A connected deployment allows you to use the administrator portal to download marketplace items.

PrerequisitesPrerequisites

您的 Azure Stack Hub 部署必須具有網際網路連線能力,並且已向 Azure 註冊。Your Azure Stack Hub deployment must have internet connectivity and be registered with Azure.

使用入口網站下載市集項目Use the portal to download marketplace items

  1. 登入 Azure Stack Hub 系統管理員入口網站。Sign into the Azure Stack Hub 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:

    在 Azure Stack Hub 系統管理員入口網站中檢閱儲存空間

  3. 開啟 Azure Stack Hub Marketplace 並連線至 Azure。Open Azure Stack Hub Marketplace and connect to Azure. 若要這樣做,請選取 [Marketplace 管理] 服務、選取 [Marketplace 項目] ,然後選取 [從 Azure 新增] :To do so, select the Marketplace management service, select Marketplace items, and then select Add from Azure:

    從 Azure 下載 Marketplace 項目

  4. 每個明細項目也會顯示目前可用的版本。Each line item also shows the currently available version. 如果可用的 Marketplace 項目有多個版本,[版本] 資料行會顯示 [多個] 。If more than one version of a Marketplace item is available, the Version column shows Multiple. 您可以按一下每個項目來檢視其描述及其他相關資訊,包括其下載大小:You can click on each item to view its description and additional information, including its download size:

    顯示 Marketplace 專案可用版本的螢幕擷取畫面。

  5. 如果項目的版本顯示為 [多個] ,您可以選取該項目,然後從產生的版本選取器下拉式清單中選擇特定版本。If the version of an item is shown as Multiple, you can select that item and then choose a specific version from the resulting version selector dropdown. 請注意,Microsoft 現在可新增屬性以根據 Azure Stack 版本或計費模型等各種屬性,禁止管理員下載與其 Azure Stack 不相容的市集產品。Note that Microsoft now has the ability to add attributes that block administrators from downloading marketplace products that are incompatible with their Azure Stack, due to various properties, such as the Azure Stack version or billing model. 只有 Microsoft 可以新增這些屬性:Only Microsoft can add these attributes:

    從 Azure 新增Add from Azure

  6. 選取您想要的項目,然後選取 [下載] 。Select the item you want, and then select Download. 下載時間會有所不同並取決於網路連線能力。Download times vary and depends on the network connectivity. 下載完成之後,您可以用 Azure Stack Hub 操作員或使用者身分來部署新 Marketplace 項目。After the download completes, you can deploy the new marketplace item as either an Azure Stack Hub operator or a user.

  7. 若要部署已下載的項目,請選取 [+ 建立資源] ,然後在類別中搜尋新的市集項目。To deploy the downloaded item, select + Create a resource, 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.

當 Azure Stack Hub 沒有網際網路連線能力或能力有限時,請使用 PowerShell 和「市集摘要整合工具」 ,將市集項目下載至具有網際網路連線能力的電腦。When Azure Stack Hub has limited or no internet connectivity, you use PowerShell and the marketplace syndication tool to download the marketplace items to a machine with internet connectivity. 然後將這些項目傳輸至您的 Azure Stack Hub 環境。You then transfer the items to your Azure Stack Hub environment. 在已中斷連線的環境中,您無法透過 Azure Stack Hub 入口網站下載 Marketplace 項目。In a disconnected environment, you can't download marketplace items by using the Azure Stack Hub portal.

市集摘要整合工具也可使用於已連線的案例中。The marketplace syndication tool can also be used in a connected scenario.

此案例分成兩部分:There are two parts to this scenario:

  • 第 1 部分:從 Marketplace 項目下載。Part 1: Download from Marketplace items. 在可存取網際網路的電腦上,設定 PowerShell、下載摘要整合工具,然後從 Azure Marketplace 下載項目。On the computer with internet access, you configure PowerShell, download the syndication tool, and then download items from Azure Marketplace.
  • 第 2 部分:上傳並發佈至 Azure Stack Hub Marketplace。Part 2: Upload and publish to Azure Stack Hub Marketplace. 將您下載的檔案移動到 Azure Stack Hub 環境,然後再發佈至 Azure Stack Hub Marketplace。You move the files you downloaded to your Azure Stack Hub environment and then publish them to Azure Stack Hub Marketplace.

PrerequisitesPrerequisites

  • 已連線的環境 (不一定要 Azure Stack Hub)。A connected environment (does not have to be Azure Stack Hub). 您必須要有連線,才能取得 Azure 的產品清單及其詳細資料,並在本機下載所有項目。You need connectivity to get the list of products from Azure with their details, and to download everything locally. 完成這項作業之後,其餘程序就不需要網際網路連線。Once this is done, the rest of the procedure does not require internet connectivity. 此作業會為您先前下載的項目建立目錄,以供您在中斷連線的環境中使用。It creates a catalog of items you've previously downloaded for you to use in your disconnected environment.

  • 卸載式媒體,用以連線至中斷連線的環境,並傳輸所有必要的成品。Removable media to connect to your disconnected environment and transfer all the necessary artifacts.

  • 已中斷連線但符合下列必要條件的 Azure Stack Hub 環境:A disconnected Azure Stack Hub environment with the following prerequisites:

使用下列命令,從 PowerShell 資源庫下載 Az administration 模組:Download the Azs.Syndication.Admin module from the PowerShell Gallery using the following command:

Install-Module -Name Azs.Syndication.Admin -AllowPrerelease -PassThru

完成 Azure Stack 的註冊後,您可以忽略下列出現在 Marketplace 管理刀鋒視窗上的訊息,因為此訊息與中斷連線的使用案例無關:Once you have registered your Azure Stack, you can disregard the following message that appears on the Marketplace management blade, as this is not relevant for the disconnected use case:

Marketplace 管理

使用市集摘要整合工具來下載市集項目Use the marketplace syndication tool to download marketplace items

重要

每當您在中斷連線的情況下下載 Marketplace 項目時,都務必要下載 Marketplace 摘要整合工具。Be sure to download the marketplace syndication tool each time you download marketplace items in a disconnected scenario. 此工具會進行頻繁的變更,因此在每次下載時均應使用最新的版本。Frequent changes are made to this tool and the most current version should be used for each download.

  1. 在具有網際網路連線的電腦上,以系統管理員身分開啟 PowerShell 主控台。On a computer with an Internet connection, open a PowerShell console as an administrator.

  2. 使用您用來註冊 Azure Stack Hub 的 Azure 帳戶,登入適當的 Azure cloud and AzureAD directory 租使用者。Sign in to the appropriate Azure cloud and AzureAD directory tenant using the Azure account that you've used to register Azure Stack Hub. 若要新增帳戶,請在 PowerShell 中執行 Connect-AzAccountTo add the account, in PowerShell run Connect-AzAccount:

    Connect-AzAccount -Environment AzureCloud -Tenant '<mydirectory>.onmicrosoft.com'
    

    當系統提示您輸入 Azure 帳戶認證時,您可能需要根據帳戶的組態使用雙因素驗證。You are prompted to enter your Azure account credentials and you might have to use two-factor authentication, depending on your account configuration.

    注意

    如果您的會話已過期,您的密碼已變更,或您想要切換帳戶,請先執行下列 Cmdlet,然後再使用:進行登入 Connect-AzAccount Remove-AzAccount -Scope ProcessIf your session expires, your password has changed, or you want to switch accounts, run the following cmdlet before you sign in using Connect-AzAccount: Remove-AzAccount -Scope Process.

  3. 如果您有多個訂用帳戶,請執行下列命令以選取您用於註冊的訂用帳戶:If you have multiple subscriptions, run the following command to select the one you used for registration:

    Get-AzSubscription -SubscriptionID 'Your Azure Subscription GUID' | Select-AzSubscription
    
  4. 如果您尚未在必要條件步驟中完成,請下載最新版本的 Marketplace 摘要整合工具:If you haven't done it in the pre-requisites step already, download the latest version of the Marketplace syndication tool:

    Install-Module -Name Azs.Syndication.Admin -AllowPrerelease -PassThru
    
  5. 若要選取要下載的 Marketplace 專案(例如 VM 映射、擴充功能或解決方案範本),請執行下列命令:To select the Marketplace items such as VM images, extensions, or solution templates to download, run the following command:

    $products = Select-AzsMarketplaceItem
    

    此命令會顯示一個資料表,其中列出了所選訂用帳戶中可用的所有 Azure Stack 註冊。This displays a table that lists all the Azure Stack registrations available in the selected subscription. 針對您所下載的市集項目,選擇符合其適用 Azure Stack 環境的註冊,然後選取 [確定] 。Choose the registration that matches the Azure Stack environment you're downloading the marketplace items for, and select OK.

    顯示所選訂用帳戶中所有可用 Azure Stack 註冊清單的螢幕擷取畫面。

    您現在應該會看到第二個資料表,其中列出了所有可供下載的市集項目。You should now see a second table listing all the marketplace items available for download. 選取您想要下載的項目,並記下 版本Select the item that you want to download and make a note of the Version. 您可以按住 Ctrl 鍵以選取多個映像。You can hold the Ctrl key to select multiple images. 顯示所選訂用帳戶中所有可用 Azure Stack 註冊的其他清單的螢幕擷取畫面。Screenshot that shows another list of all the Azure Stack registrations available in the selected subscription.

    您也可以使用 [新增條件] 選項來篩選映像清單。You can also filter the list of images by using the Add criteria option. 選取 Azure Stack 註冊Select Azure Stack Registrations

    選擇完畢後,請選取 [確定]。Once you've made your selections, select OK.

  6. 您已選取要下載的 Marketplace 專案的識別碼會儲存在變數中 $productsThe IDs for the Marketplace items you've selected for download are saved in the $products variable. 請使用下列命令開始下載選取的項目。Use the command below to begin downloading the selected items. 使用一個位置取代目的地資料夾路徑,以儲存您從 Azure Marketplace 下載的檔案:Replace the destination folder path with a location to store the files you download from Azure Marketplace:

    $products | Export-AzsMarketplaceItem  -RepositoryDir "Destination folder path in quotes"
    
  7. 下載所需的時間取決於項目的大小。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. 下載包含 VHD 檔案 (用於虛擬機器) 或 .zip 檔案 (用於虛擬機器擴充功能和資源提供者)。The download includes a VHD file (for virtual machines), or a .zip file (for virtual machine extensions and resource providers). 其中也可能包含 .azpkg 格式的資源庫套件 (其為 .zip 檔案)。It might also include a gallery package in the .azpkg format, which is a .zip file.

  8. 如果下載失敗,重新執行下列 PowerShell Cmdlet 即可再試一次:If the download fails, you can try again by re-running the following PowerShell cmdlet:

    $products | Export-AzsMarketplaceItem  -RepositoryDir "Destination folder path in quotes"
    
  9. 您也應該在本機匯出 Az 的系統 管理 模組,以便將它複製到您要匯入 Marketplace 專案的電腦上 Azure Stack Hub。You should also export the Azs.Syndication.Admin module locally so that you can copy it over to the machine from which you are importing Marketplace items to Azure Stack Hub.

    注意

    用於匯出此模組的目的地資料夾,應該不同於市集項目的匯出所在位置。The destination folder for exporting this module should be different from the location to which you have exported the marketplace items.

    Save-Package -ProviderName NuGet -Source https://www.powershellgallery.com/api/v2 -Name Azs.Syndication.Admin -Path "Destination folder path in quotes" -Force
    

使用 PowerShell 匯入下載並發佈至 Azure Stack Hub MarketplaceImport the download and publish to Azure Stack Hub Marketplace using PowerShell

  1. 您必須將先前下載到本機的檔案移至可連線到 Azure Stack Hub 環境的機器。You must move the files that you have previously downloaded locally to a machine that has connectivity to your Azure Stack Hub environment. Marketplace 摘要整合工具也必須可供您的 Azure Stack Hub 環境使用,因為您必須使用此工具來執行匯入作業。The marketplace syndication tool must also be available to your Azure Stack Hub environment because you need to use the tool to perform the import operation.

    下圖顯示資料夾結構範例。The following image shows a folder structure example. D:\downloadfolder 包含所有已下載的市集項目。D:\downloadfolder contains all the downloaded marketplace items. 每個子資料夾都是市集項目 (例如 microsoft.custom-script-linux-arm-2.0.3),並且依產品識別碼命名。Each subfolder is a marketplace item (for example, microsoft.custom-script-linux-arm-2.0.3), named by the product ID. 每個子資料夾都內含 Marketplace 項目的下載內容。Inside each subfolder is the marketplace item's downloaded content.

    Marketplace 下載目錄結構

  2. 請依照這篇文章中的指示,設定 Azure Stack Hub 操作員的 PowerShell 工作階段。Follow the instructions in this article to configure the Azure Stack Hub Operator PowerShell session.

  3. 使用具有「預設提供者訂用帳戶」擁有者存取權的身分識別登入您的 Azure Stack Hub。Sign in to your Azure Stack Hub with an identity that has owner access to the "Default Provider Subscription".

  4. 匯入摘要整合模組,然後執行下列指令碼來啟動 Marketplace 摘要整合工具:Import the syndication module and then launch the marketplace syndication tool by running the following script:

    Import-AzsMarketplaceItem -RepositoryDir "Source folder path in quotes"
    
  5. 指令碼順利完成之後,您應該就能在 Azure Stack Hub Marketplace 中取得市集項目。After the script successfully completes, the marketplace items should be available in Azure Stack Hub Marketplace.