Azure 上的 Visual Studio 映像Visual Studio images on Azure

使用预配置的 Azure 虚拟机 (VM) 中的 Visual Studio 是从无到启动并运行的开发环境的简单快捷方法。Using Visual Studio in a preconfigured Azure virtual machine (VM) is a quick, easy way to go from nothing to an up-and-running development environment. 具有不同 Visual Studio 配置的系统映像位于 Azure 市场System images with different Visual Studio configurations are available in the Azure Marketplace.

不熟悉 Azure?New to Azure? 创建一个 Azure 试用帐户Create a trial Azure account.

备注

并非所有订阅都可以部署 Windows 10 映像。Not all subscriptions are eligible to deploy Windows 10 images. 有关详细信息,请参阅在 Azure 中使用 Windows 客户端实现开发/测试方案For more information see Use Windows client in Azure for dev/test scenarios

提供了哪些配置和版本?What configurations and versions are available?

在 Azure 市场中,可以找到最新主版本(Visual Studio 2019、Visual Studio 2017 和 Visual Studio 2015)的映像。Images for the most recent major versions, Visual Studio 2019, Visual Studio 2017 and Visual Studio 2015, can be found in the Azure Marketplace. 对于发布的每个主版本,都可以看到最初的“发布到 Web”(RTW) 版本和最新更新版本。For each released major version, you see the originally "released to web" (RTW) version and the latest updated versions. 其中每个版本都提供 Visual Studio Enterprise 和 Visual Studio Community 版本。Each of these versions offers the Visual Studio Enterprise and the Visual Studio Community editions. 这些映像至少每个月更新一次,以包括最新的 Visual Studio 和 Windows 更新。These images are updated at least every month to include the latest Visual Studio and Windows updates. 尽管映像的名称保持不变,但每个映像的说明包括已安装的产品版本和映像的截止日期。While the names of the images remain the same, each image's description includes the installed product version and the image's "as of" date.

发行版本Release version 版本Editions 产品版本Product version
Visual Studio 2019:最新(版本 16.5)Visual Studio 2019: Latest (Version 16.5) Enterprise、CommunityEnterprise, Community 版本 16.5.4Version 16.5.4
Visual Studio 2019:RTWVisual Studio 2019: RTW EnterpriseEnterprise 版本 16.0.13Version 16.0.13
Visual Studio 2017:最新(版本 15.9)Visual Studio 2017: Latest (Version 15.9) Enterprise、CommunityEnterprise, Community 版本 15.9.22Version 15.9.22
Visual Studio 2017:RTWVisual Studio 2017: RTW Enterprise、CommunityEnterprise, Community 版本 15.0.28Version 15.0.28
Visual Studio 2015:最新 (Update 3)Visual Studio 2015: Latest (Update 3) Enterprise、CommunityEnterprise, Community 版本 14.0.25431.01Version 14.0.25431.01

备注

根据 Azure 服务策略,Visual Studio 2015 最初发布的 (RTW) 版本已过期,无法提供服务。In accordance with Azure servicing policy, the originally released (RTW) version of Visual Studio 2015 has expired for servicing. Visual Studio 2015 Update 3 是为 Visual Studio 2015 产品线提供的唯一剩余版本。Visual Studio 2015 Update 3 is the only remaining version offered for the Visual Studio 2015 product line.

有关详细信息,请参阅 Visual Studio 维护策略For more information, see the Visual Studio Servicing Policy.

安装了哪些功能?What features are installed?

每个映像都包含为该 Visual Studio 版本推荐的功能集。Each image contains the recommended feature set for that Visual Studio edition. 通常,安装包括:Generally, the installation includes:

  • 所有可用工作负荷,包括每个工作负荷推荐的可选组件All available workloads, including each workload's recommended optional components
  • .NET 4.6.2 和 .NET 4.7 SDK、目标包和开发人员工具.NET 4.6.2 and .NET 4.7 SDKs, Targeting Packs, and Developer Tools
  • Visual F#Visual F#
  • 适用于 Visual Studio 的 GitHub 扩展GitHub Extension for Visual Studio
  • LINQ to SQL 工具LINQ to SQL Tools

生成映像时用于安装 Visual Studio 的命令行如下所示:The command line used to install Visual Studio when building the images is as follows:

    vs_enterprise.exe --allWorkloads --includeRecommended --passive ^
       add Microsoft.Net.Component.4.7.SDK ^
       add Microsoft.Net.Component.4.7.TargetingPack ^ 
       add Microsoft.Net.Component.4.6.2.SDK ^
       add Microsoft.Net.Component.4.6.2.TargetingPack ^
       add Microsoft.Net.ComponentGroup.4.7.DeveloperTools ^
       add Microsoft.VisualStudio.Component.FSharp ^
       add Component.GitHub.VisualStudio ^
       add Microsoft.VisualStudio.Component.LinqToSql

如果映像未包含所需 Visual Studio 功能,请通过页面右上角的反馈工具提供反馈。If the images don't include a Visual Studio feature that you require, provide feedback through the feedback tool in the upper-right corner of the page.

应选择什么大小的 VM?What size VM should I choose?

Azure 提供各种虚拟机大小。Azure offers a full range of virtual machine sizes. 由于 Visual Studio 是一个功能强大的多线程应用程序,因此 VM 大小需要包含至少两个处理器和 7 GB 内存。Because Visual Studio is a powerful, multi-threaded application, you want a VM size that includes at least two processors and 7 GB of memory. 我们为 Visual Studio 映像建议以下 VM 大小:We recommend the following VM sizes for the Visual Studio images:

  • Standard_D2_v3Standard_D2_v3
  • Standard_D2s_v3Standard_D2s_v3
  • Standard_D4_v3Standard_D4_v3
  • Standard_D4s_v3Standard_D4s_v3
  • Standard_D2_v2Standard_D2_v2
  • Standard_D2S_v2Standard_D2S_v2
  • Standard_D3_v2Standard_D3_v2

有关最新虚拟机大小的详细信息,请参阅 Azure 中的 Windows 虚拟机大小For more information on the latest machine sizes, see Sizes for Windows virtual machines in Azure.

使用 Azure,可通过调整 VM 大小来重新平衡初始选择。With Azure, you can rebalance your initial choice by resizing the VM. 可为新的 VM 预配更合适的大小,也可调整现有 VM 的大小,使其适应不同的底层硬件。You can either provision a new VM with a more appropriate size, or resize your existing VM to different underlying hardware. 有关详细信息,请参阅调整 Windows VM 大小For more information, see Resize a Windows VM.

VM 运行后,下一步是什么?After the VM is running, what's next?

Visual Studio 遵循 Azure 中的“自带许可”模式。Visual Studio follows the "bring your own license" model in Azure. 与专有硬件上的安装一样,第一步是授权 Visual Studio 安装。As with an installation on proprietary hardware, one of the first steps is licensing your Visual Studio installation. 若要解锁 Visual Studio,请执行以下任一操作:To unlock Visual Studio, either:

  • 使用与 Visual Studio 订阅关联的 Azure 帐户登录Sign in with a Azure account that's associated with a Visual Studio subscription
  • 使用最初购买附带的产品密钥解锁 Visual StudioUnlock Visual Studio with the product key that came with your initial purchase

有关详细信息,请参阅登录 Visual Studio如何解锁 Visual StudioFor more information, see Sign in to Visual Studio and How to unlock Visual Studio.

如何保存开发 VM 供将来使用或供团队使用?How do I save the development VM for future or team use?

开发环境的范围很大,而构建出较复杂环境有一些相关的实际成本。The spectrum of development environments is huge, and there's real cost associated with building out the more complex environments. 不管环境如何配置,都可以将已配置的 VM 保存为或捕获为“基础映像”供将来使用或供团队的其他成员使用。Regardless of your environment's configuration, you can save, or capture, your configured VM as a "base image" for future use or for other members of your team. 然后,启动新的 VM 时,从基础映像(而不是 Azure 市场映像)对其进行预配。Then, when booting a new VM, you provision it from the base image rather than the Azure Marketplace image.

快速摘要:使用系统准备工具 (Sysprep) 关闭正在运行的 VM,然后通过 Azure 门户的 UI 将 VM 捕获为映像(图 1)。A quick summary: Use the System Preparation tool (Sysprep) and shut down the running VM, and then capture (Figure 1) the VM as an image through the UI in the Azure portal. Azure 会将包含该映像的 .vhd 文件保存在所选存储帐户中。Azure saves the .vhd file that contains the image in the storage account of your choosing. 然后,新映像在订阅的资源列表中显示为映像资源。The new image then shows up as an Image resource in your subscription's list of resources.

Capture an image through the Azure portal UI

(图 1)通过 Azure 门户 UI 捕获映像。
(Figure 1) Capture an image through the Azure portal UI.

有关详细信息,请参阅在 Azure 中创建通用 VM 的托管映像For more information, see Create a managed image of a generalized VM in Azure.

重要

不要忘记使用 Sysprep 来准备 VM。Don't forget to use Sysprep to prepare the VM. 如果缺少该步骤,Azure 无法从映像配置 VM。If you miss that step, Azure can't provision a VM from the image.

备注

仍需花费一些成本来存储映像,但与从头开始重建 VM 的开销成本相比,对每个需要 VM 的团队成员而言,这种增量成本可能微不足道。You still incur some cost for storage of the images, but that incremental cost can be insignificant compared to the overhead costs to rebuild the VM from scratch for each team member who needs one. 例如,每月创建和存储一个 127 GB 的映像只需花费几十元人民币,整个团队都可重复使用该映像。For instance, it costs a few dozen CNY to create and store a 127-GB image for a month that's reusable by your entire team. 但是,与每位员工为构建和验证正确配置的开发箱以供个人使用而投入的时间相比,这些成本微不足道。However, these costs are insignificant compared to hours each employee invests to build out and validate a properly configured dev box for their individual use.

此外,开发任务或技术可能需要更大的规模,如各种开发配置和多种计算机配置。Additionally, your development tasks or technologies might need more scale, like varieties of development configurations and multiple machine configurations. 可使用 Azure 开发测试实验室,创建可自动构造“黄金映像”的配方。You can use Azure DevTest Labs to create recipes that automate construction of your "golden image." 还可以使用开发测试实验室管理团队正在运行的 VM 策略。You can also use DevTest Labs to manage policies for your team's running VMs.

后续步骤Next steps

了解预配置的 Visual Studio 映像后,下一步是创建新 VM:Now that you know about the preconfigured Visual Studio images, the next step is to create a new VM: