Storage Mover 是最上層資源,並部署至 Azure 資源群組。 Storage Mover 代理程式會註冊 Storage Mover。 Storage Mover 也會保存移轉專案,以及您在 Azure 中定義及監視將個別來源移轉至其目標所需的一切。
在本文中,您將了解如何將 Storage Mover 部署至資源群組。
必要條件
您應先閱讀 規劃 Storage Mover 部署一文,再繼續開始進行第一次部署。 本文會分享為 Storage Mover 選取 Azure 區域的最佳做法,您應考慮建立的 Storage Mover 資源數目,以及更實用的見解。
部署 Storage Mover 資源之前,請確定您在選取的訂閱和資源群組中具有適當的權限。
如果此訂閱中從未部署過 Storage Mover,而且您不是訂閱擁有者,請檢閱在先前所述的計劃指南中準備好您的訂閱一節。
若要將 Storage Mover 部署至資源群組,您必須是所選資源群組的「參與者」或「擁有者」RBAC (角色型存取控制) 角色的成員。 計劃指南中權限一節的表格已列出各種移轉案例所需的權限。
建立 Storage Mover 時您需要決定訂閱、資源群組、區域和名稱。 規劃 Azure Storage Mover 部署一文會介紹最佳做法。 請參閱資源命名慣例,以選擇支援的名稱。
部署儲存體移動器資源
瀏覽至 Azure 入口網站中的 [建立資源] 連結。
搜尋 Azure Storage Mover。 當您找到正確的搜尋結果時,請選取 [建立] 按鈕。 建立 Storage Mover 資源的精靈會隨即開啟。
為您的 Azure CLI 環境做準備
若要建立 Storage Mover,請使用 [az storage-mover create] 命令: 您必須提供 --name
、--resource-group
和 --location
參數必要的值。 -description
和 tags
參數為選用參數。
## Log into your Azure CLI account, a browser window will appear so that you can confirm your login.
az login
## The Azure Storage Mover extension for CLI is not installed by default and needs to be installed manually. Install the Azure Storage Mover extension without a prompt.
az config set extension.use_dynamic_install=yes_without_prompt
## Set variables
$storageMoverName = "The name of the Storage Mover resource."
$resourceGroupName = "Name of resource group"
$description = "A description for the storage mover."
$location = "The geo-location where the resource lives. When not specified, the location fo the resource group will be used."
$tags = "Resource tags. Support shorthand-syntax, json-file and yaml-file. Try '??' to show more."
## Create a Storage Mover resource.
az storage-mover create --Name $storageMoverName \
--ResourceGroupName $resourceGroupName \
--Location $location \
若要準備您的 Azure PowerShell 環境
- 如果您選擇在本機使用 Azure PowerShell:
- 如果您選擇使用 Azure Cloud Shell:
New-AzStorageMover
Cmdlet 可用來在資源群組中建立新的 Storage Mover 資源。 如果您尚未安裝 Az.StorageMover
模組:
## Ensure you are running the latest version of PowerShell 7
$PSVersionTable.PSVersion
## Your local execution policy must be set to at least remote signed or less restrictive
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
## If you don't have the general Az PowerShell module, install it first
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
## Lastly, the Az.StorageMover module is not installed by default and must be manually requested.
Install-Module -Name Az.StorageMover -Scope CurrentUser -Repository PSGallery -Force
安裝 Azure PowerShell 文章包含更多詳細資料。
若要部署 Storage Mover 資源,您必須提供必要 -Name
、-ResourceGroupName
和 -Region
參數的值。 -Description
是選用參數。
## Set variables
$subscriptionID = "Your subscription ID"
$resourceGroupName = "Your resource group name"
$storageMoverName = "Your storage mover name"
$description = "Optional, up to 1024 characters"
## Log into Azure with your Azure credentials
Connect-AzAccount -SubscriptionId $subscriptionID
## If this is the first storage mover resource deployed in this subscription:
## You need to manually register the resource provider namespaces Microsoft.StorageMover and Microsoft.HybridCompute with your subscription.
## This only needs to be done once per subscription. You must have at least Contributor permissions (RBAC role) on the subscription.
Register-AzResourceProvider -ProviderNamespace Microsoft.StorageMover
Register-AzResourceProvider -ProviderNamespace Microsoft.HybridCompute
## The value for the Azure region of your resource stems from an enum.
## To find the correct Location value for your selected Azure region, run:
## Get-AzLocation | select displayname,location
## Create a storage mover resource
New-AzStorageMover `
-Name $storageMoverName `
-ResourceGroupName $resourceGroupName `
-Location "Your Location value"
下一步
請前進到下列其中一篇文章,以了解如何部署 Storage Mover 代理程式或建立移轉專案。