共用方式為


在 Azure Stack Hub 上的 Azure App Service 中新增背景工作角色和基礎結構

此文件提供如何在 Azure Stack Hub 上的 Azure App Service 中調整基礎結構和背景工作角色的相關指示。 我們將說明建立額外的背景工作角色以支援任何規模的應用程式所需的所有步驟。

注意

如果您「Azure Stack Hub 環境」的 RAM 未超過 96 GB,您可能很難增加額外的容量。

根據預設,Azure Stack Hub 上的 Azure App Service 支援免費和共用背景工作角色層。 若要新增其他背景工作角色層,您需要新增更多背景工作角色。

如果您不確定透過預設的 Azure Stack Hub 上的 Azure App Service 安裝部署了哪個項目,您可以檢閱 Azure Stack Hub 上的 App Service 概觀中的其他資訊。

Azure Stack Hub 上的 Azure App Service 會使用虛擬機器擴展集部署所有角色,實質上利用此工作負載的縮放功能。 因此,所有背景工作層的縮放是透過 App Service 管理員完成。

使用 PowerShell 來新增額外的背景工作

  1. 在 PowerShell 中設定 Azure Stack Hub 管理環境

  2. 使用下列範例來擴增擴展集。

    
    ##### Scale out the AppService Role instances ######
    
    # Set context to AzureStack admin.
    Connect-AzAccount -EnvironmentName AzureStackAdmin
    
    ## Name of the Resource group where AppService is deployed.
    $AppServiceResourceGroupName = "AppService.local"
    
    ## Name of the ScaleSet : e.g. FrontEndsScaleSet, ManagementServersScaleSet, PublishersScaleSet , LargeWorkerTierScaleSet,      MediumWorkerTierScaleSet, SmallWorkerTierScaleSet, SharedWorkerTierScaleSet
    $ScaleSetName = "SharedWorkerTierScaleSet"
    
    ## TotalCapacity is sum of the instances needed at the end of operation. 
    ## e.g. if your VMSS has 1 instance(s) currently and you need 1 more the TotalCapacity should be set to 2
    $TotalCapacity = 2  
    
    # Get current scale set
    $vmss = Get-AzVmss -ResourceGroupName $AppServiceResourceGroupName -VMScaleSetName $ScaleSetName
    
    # Set and update the capacity
    $vmss.sku.capacity = $TotalCapacity
    Update-AzVmss -ResourceGroupName $AppServiceResourceGroupName -Name $ScaleSetName -VirtualMachineScaleSet $vmss 
    

    注意

    視角色類型和執行個體數目而定,此步驟可能需要幾小時的時間才能完成。

  3. 在 App Service 系統管理中監視新角色執行個體的狀態。 若要檢查個別角色執行個體的狀態,請在清單中按一下角色類型。

使用系統管理員入口網站新增其他背景工作角色

  1. 以服務管理員身分登入 Azure Stack Hub 系統管理員入口網站。

  2. 瀏覽至 [App Service]。

    Azure Stack Hub 系統管理員入口網站中的 App Service

  3. 按一下 [角色]。 您可以在這裡看到所有已部署之 App Service 角色的明細。

  4. 以滑鼠右鍵按一下您想要調整的類型列,然後按一下 [ScaleSet]

    Azure Stack Hub 系統管理員入口網站中的 ScaleSet App Service 角色

  5. 按一下 [調整大小],選取您想要調整為多少執行個體數,然後按一下 [儲存]。

    在 Azure Stack Hub 系統管理員入口網站中設定要在 App Service 角色中調整的執行個體

  6. Azure Stack Hub 上的 Azure App Service 現在將新增額外的 VM、設定它們、安裝所有必要的軟體,並在完成此程序時將它們標示為就緒。 此程序大約需要 80 分鐘。

  7. 您可以檢視 [角色] 刀鋒視窗中的背景工作,來監視整備新角色的進度。

結果

在將它們完整部署並且準備好後,背景工作會變成可供使用者用來將工作負載部署到當中。 下列螢幕擷取畫面顯示依預設可用的多個定價層範例。 如果特定的背景工作層沒有可用的背景工作,就無法使用選擇對應定價層的選項。

Azure Stack Hub 系統管理員入口網站中新 App Service 方案的定價層

注意

若要擴增管理、前端或發行者角色,請遵循相同的步驟來選取適當的角色類型。 控制項不會部署為擴展集,因此這兩者應在所有生產環境部署的安裝期間進行部署。

後續步驟

設定部署來源