如何在 Azure 上部署 Windows 11
适用于:✔️ Windows VM ✔️ 灵活规模集
对于其用户使用 Windows 11 企业版 E3/E5 或使用 Azure 虚拟桌面访问(用户订阅许可证或附加设备用户订阅许可证)的客户,通过使用 Windows 11 多租户托管权限,他们可以在云中使用其 Windows 11 许可证并在 Azure 上运行 Windows 11 虚拟机,无需购买其他许可证。
有关详细信息,请参阅适用于 Windows 11 的多租户托管。
备注
- 若要使用 Windows 7 和 Windows 10 映像进行开发或测试,请参阅 Azure 中适用于开发/测试方案的 Windows 客户端
- 学生版和试用版帐户可以部署 Windows 11 映像以进行开发或测试。
- 有关 Windows Server 许可权益,请参阅 Windows Server 映像的 Azure 混合使用权益。
- 选择 VM 大小时,请确保大小满足 Windows 11硬件最低要求
若要详细了解有资格在 Azure 上运行 Windows 11 的订阅许可证,请下载适用于虚拟桌面的 Windows 11 许可简述
可以选择操作系统,供会话主机用来提供虚拟桌面和远程应用。 可以使用具有不同主机池的不同操作系统来为用户提供灵活性。 支持的日期符合 Microsoft 生命周期策略。 我们支持以下操作系统的 64 位版本:
- Windows 11 企业版多会话
- Windows 11 企业版
- Windows 10 企业版 1909 及更高版本(用于 Windows 10 部署)
- Microsoft 365 E3、E5、A3、A5、F3、商业高级版、学生使用权益
- Windows 企业版 E3、E5
- Windows VDA E3、E5
- Windows 教育版 A3、A5
外部用户可以使用按用户访问定价,而不是许可证权利。
对于 PowerShell、CLI 和 Azure 资源管理器模板部署,可以使用 PublisherName: MicrosoftWindowsDesktop
和 Offer: Windows-11
找到 Windows 11 映像。
$location="chinaeast"
Get-AzVmImageSku -Location '$location' -PublisherName 'MicrosoftWindowsDesktop' -Offer 'Windows-11'
Skus Offer PublisherName Location
---- ----- ------------- --------
win11-21h2-avd Windows-11 MicrosoftWindowsDesktop chinaeast
win11-21h2-ent Windows-11 MicrosoftWindowsDesktop chinaeast
win11-21h2-entn Windows-11 MicrosoftWindowsDesktop chinaeast
win11-21h2-pro Windows-11 MicrosoftWindowsDesktop chinaeast
win11-21h2-pro-zh-cn Windows-11 MicrosoftWindowsDesktop chinaeast
win11-21h2-pron Windows-11 MicrosoftWindowsDesktop chinaeast
win11-22h2-avd Windows-11 MicrosoftWindowsDesktop chinaeast
win11-22h2-ent Windows-11 MicrosoftWindowsDesktop chinaeast
win11-22h2-entn Windows-11 MicrosoftWindowsDesktop chinaeast
win11-22h2-pro Windows-11 MicrosoftWindowsDesktop chinaeast
win11-22h2-pro-zh-cn Windows-11 MicrosoftWindowsDesktop chinaeast
win11-22h2-pron Windows-11 MicrosoftWindowsDesktop chinaeast
有关可用映像的详细信息,请参阅通过 Azure PowerShell 查找和使用 Azure 市场 VM 映像
备注
如果你要升级到启用了受信任启动的较新版 Windows 11,并且当前使用的 Windows 11 版本未启用受信任启动,则需要在继续升级之前解除分配 VM。 有关详细信息,请参阅在现有 Azure VM 上启用受信任启动
如果要上传通用化的 Windows 11 VHD,请注意,Windows 11 不会默认启用内置 Administrator 帐户。 若要启用内置 Administrator 帐户,请在自定义脚本扩展中包含以下命令。
Net user <username> /active:yes
以下 PowerShell 代码片段用于将所有管理员(包括内置 Administrator)帐户标记为活动帐户。 如果内置 Administrator 用户名未知,此示例非常有用。
$adminAccount = Get-WmiObject Win32_UserAccount -filter "LocalAccount=True" | ? {$_.SID -Like "S-1-5-21-*-500"}
if($adminAccount.Disabled)
{
$adminAccount.Disabled = $false
$adminAccount.Put()
}
参考信息:
确保已安装并配置最新的 Azure PowerShell。 准备好 VHD 之后,即可使用 Add-AzVhd
cmdlet 将 VHD 上传到 Azure 存储帐户,如下所示:
Add-AzVhd -ResourceGroupName "myResourceGroup" -LocalFilePath "C:\Path\To\myvhd.vhd" `
-Destination "https://mystorageaccount.blob.core.chinacloudapi.cn/vhds/myvhd.vhd"
使用 Azure 资源管理器模板部署进行部署 在资源管理器模板中,可为 licenseType
指定一个附加参数。 可以阅读有关创作 Azure Resource Manager 模板的详细信息。 将 VHD 上传到 Azure 之后,请编辑资源管理器模板以将许可证类型包括在计算提供程序中,然后照常部署模板:
"properties": {
"licenseType": "Windows_Client",
"hardwareProfile": {
"vmSize": "[variables('vmSize')]"
}
通过 PowerShell 进行部署 通过 PowerShell 部署 Windows Server VM 时,需为 -LicenseType
添加另一参数。 将 VHD 上传到 Azure 之后,可以使用 New-AzVM
创建 VM 并指定许可类型,如下所示:
New-AzVM -ResourceGroupName "myResourceGroup" -Location "China North" -VM $vm -LicenseType "Windows_Client"
通过 PowerShell 或资源管理器部署方法部署 VM 之后,请使用 Get-AzVM
验证许可证类型:
Get-AzVM -ResourceGroup "myResourceGroup" -Name "myVM"
输出类似于许可证类型正确的 Windows 10 的以下示例:
Type : Microsoft.Compute/virtualMachines
Location : chinanorth
LicenseType : Windows_Client
以下 VM 在部署时未提供 Azure 混合使用权益许可(例如直接从 Azure 库部署 VM),可看出其中的输出差异:
Type : Microsoft.Compute/virtualMachines
Location : chinanorth
LicenseType :
Azure 使用内置管理员帐户预配所有 Windows VM,但不能使用它加入 Microsoft Entra ID。 例如,“设置”>“帐户”>“访问工作或学校帐户”>“+ 连接”将不起作用。 若要手动加入 Microsoft Entra ID,必须创建另一个管理员帐户并以其身份登录。 还可以使用预配包配置 Microsoft Entra ID;请使用“后续步骤”部分中的链接了解详细信息。
- 深入了解为 Windows 11 配置 VDA
- 深入了解 Windows 11 的多租户托管