中国区 Azure 开发人员入门指南Get started guide for Azure in China developers

什么是 Azure?What is Azure?

Azure 是一个完整的云平台,可以托管你现有的应用程序,简化新应用程序的开发,甚至还可以增强本地应用程序的功能。Azure is a complete cloud platform that can host your existing applications, streamline the development of new applications, and even enhance on-premises applications. 在充分利用云计算效率的同时,Azure 集成了开发、测试、部署和管理应用程序所需的各种云服务。Azure integrates the cloud services that you need to develop, test, deploy, and manage your applications—while taking advantage of the efficiencies of cloud computing.

通过在 Azure 中托管应用程序,你可以随着客户需求的增长,从小规模开始轻松扩展应用程序。By hosting your applications in Azure, you can start small and easily scale your application as your customer demand grows. 另外,Azure 还可以针对高可用性应用程序提供所需的可靠性,甚至包括在两个不同区域之间的故障转移。Azure also offers the reliability that’s needed for high-availability applications, even including failover between different regions. 通过 Azure 门户,可让你轻松管理所有的 Azure 服务。The Azure portal lets you easily manage all your Azure services. 同时,你还可以通过使用特定于服务的 API 和模板以编程方式管理你的服务。You can also manage your services programmatically by using service-specific APIs and templates.

目标读者:本指南将面向应用程序开发人员介绍 Azure 平台。Who should read this: This guide is an introduction to the Azure platform for application developers. 针对在 Azure 中开始生成新的应用程序或将现有应用程序迁移到 Azure 所需的操作,提供相关指导和说明。It provides guidance and direction that you need to start building new applications in Azure or migrating existing applications to Azure.

从哪里开始?Where do I start?

面对 Azure 提供的众多服务,想要从中找出支持你解决方案体系结构的服务,也是一项艰巨的任务。With all the services that Azure offers, it can be a daunting task to figure out which services you need to support your solution architecture. 本部分将重点介绍开发人员通常使用的 Azure 服务。This section highlights the Azure services that developers commonly use. 有关所有 Azure 服务列表,请参阅 Azure 文档For a list of all Azure services, see the Azure documentation.

首先,你必须确定在 Azure 中托管应用程序的方式。First, you must decide on how to host your application in Azure. 是否需要将整个基础结构作为一台虚拟机 (VM) 来管理。Do you need to manage your entire infrastructure as a virtual machine (VM). 是否可以使用 Azure 提供的平台管理功能?Can you use the platform management facilities that Azure provides? 或许你只需要一个无服务器框架来托管代码执行?Maybe you need a serverless framework to host code execution only?

应用程序需要云存储,Azure 为此提供了若干选项。Your application needs cloud storage, which Azure provides several options for. 你可以利用 Azure 的企业身份验证。You can take advantage of Azure's enterprise authentication. 此外,还有用于基于云开发和监视的各种工具,并且大多数托管服务都提供 DevOps 集成。There are also tools for cloud-based development and monitoring, and most hosting services offer DevOps integration.

现在,让我们先看一下我们建议的用于应用程序调查的特定服务。Now, let's look at some of the specific services that we recommend investigating for your applications.

应用程序托管Application hosting

Azure 提供了多个基于云的计算服务来运行你的应用程序,因此,你无需担心基础结构详细信息。Azure provides several cloud-based compute offerings to run your application so that you don't have to worry about the infrastructure details. 随着应用程序使用率的增长,可轻松增加或扩大你的资源。You can easily scale up or scale out your resources as your application usage grows.

Azure 提供了支持应用程序开发和托管需求的服务。Azure offers services that support your application development and hosting needs. Azure 还提供了基础结构即服务 (IaaS),以便让你完全控制应用程序托管。Azure provides infrastructure-as-a-service (IaaS) to give you full control over your application hosting. Azure 的平台即服务 (PaaS) 产品提供了支持应用所需的完全托管服务。Azure's platform-as-a-service (PaaS) offerings provide the fully managed services needed to power your apps. 在 Azure 中甚至还有真正的无服务器托管,你在其中需要做的就是编写代码。There is even true serverless hosting in Azure where all you need to do is write your code.

Azure 应用程序托管选项

Azure 应用服务Azure App Service

如果你希望以最快路径发布基于 Web 的项目,则可以考虑使用 Azure 应用服务。When you want the quickest path to publish your web-based projects, consider Azure App Service. 通过应用服务,可以轻松扩展 Web 应用以支持移动客户端,并发布易于使用的 REST API。App Service makes it easy to extend your web apps to support your mobile clients and publish easily consumed REST APIs. 此平台通过使用社交提供程序、基于流量的自动缩放、在生产中测试和基于容器的持续部署来提供身份验证。This platform provides authentication by using social providers, traffic-based autoscaling, testing in production, and continuous and container-based deployments.

可以创建 Web 应用、移动应用后端和 API 应用。You can create web apps, mobile app back ends, and API apps.

由于所有上述三个应用类型均共享应用服务运行时,因此,你可以托管网站,支持移动客户端,并在 Azure 中公开你的 API,所有这些均可在同一个项目或解决方案中完成。Because all three app types share the App Service runtime, you can host a website, support mobile clients, and expose your APIs in Azure, all from the same project or solution. 若要详细了解应用服务,请参阅什么是 Azure Web 应用To learn more about App Service, see What is Azure Web Apps.

应用服务在设计之初就考虑到了 DevOps。App Service has been designed with DevOps in mind. 它可以支持各种用于发布和持续集成部署的工具,包括 GitHub webhook、Jenkins、Visual Studio Team Services、TeamCity 等。It supports various tools for publishing and continuous integration deployments, including GitHub webhooks, Jenkins, Visual Studio Team Services, TeamCity, and others.

开始使用:通过应用服务,可以轻松创建和部署你的第一个 Web 应用移动应用,或 API 应用Get started: App Service makes it easy to create and deploy your first web app, mobile app, or API app.

Azure 虚拟机Azure Virtual Machines

作为一个基础结构即服务 (IaaS) 提供程序,Azure 可让你部署到或将应用程序迁移到 Windows 或 Linux VM。As an infrastructure-as-a-service (IaaS) provider, Azure lets you deploy to or migrate your application to either Windows or Linux VMs. Azure 虚拟机连同 Azure 虚拟网络一起,可支持将 Windows 或 Linux VM 部署到 Azure。Together with Azure Virtual Network, Azure Virtual Machines supports the deployment of Windows or Linux VMs to Azure. 通过 VM,你可以全面控制计算机的配置。With VMs, you have total control over the configuration of the machine. 使用 VM 时,你将负责所有服务器软件的安装、配置、维护和操作系统修补。When using VMs, you’re responsible for all server software installation, configuration, maintenance, and operating system patches.

由于你对 VM 拥有所有控制级别,因此,你可以在 Azure 上运行大量不适合 PaaS 模型的服务器工作负载。Because of the level of control that you have with VMs, you can run a wide range of server workloads on Azure that don’t fit into a PaaS model. 这些工作负载可包括数据库服务器、Windows Server Active Directory 和 Microsoft SharePoint。These workloads include database servers, Windows Server Active Directory, and Microsoft SharePoint. 有关详细信息,请参阅 LinuxWindows 的虚拟机文档。For more information, see the Virtual Machines documentation for either Linux or Windows.

何时使用:在你需要完全控制应用程序基础结构,或将本地应用程序工作负载迁移到 Azure 而无需进行更改的情况下,可以使用虚拟机。When to use: Use Virtual Machines when you want full control over your application infrastructure or to migrate on-premises application workloads to Azure without having to make changes.

开始使用:从 Azure 门户创建 Linux VMWindows VMGet started: Create a Linux VM or Windows VM from the Azure portal.

Azure Functions(无服务器)Azure Functions (serverless)

Note

Azure Functions 目前在中国不可用。Azure Functions is not available in China yet.

你无需担心构建和管理整个应用程序或运行代码的基础结构。Rather than of worrying about building out and managing a whole application or the infrastructure to run your code. 而是,只需编写代码并以响应事件的方式或按计划来运行代码,那会是怎样?What if you could just write your code and have it run in response to events or on a schedule? Azure Functions 是一个“无服务器”样式的产品,可让你仅编写所需的代码。Azure Functions is a "serverless"-style offering that lets you write just the code you need. 借助 Functions,将通过 HTTP 请求、webhook、云服务事件,或按计划触发代码执行。With Functions, code execution is triggered by HTTP requests, webhooks, cloud service events, or on a schedule. 你可以使用所选的开发语言开发编码,如 C#、F#、Node.js、Python 或 PHP。You can code in your development language of choice, such as C#, F#, Node.js, Python, or PHP. 使用基于消耗的计费方式,只需要支付代码执行的时间,并且 Azure 可根据需要进行扩展。With consumption-based billing, you pay only for the time that your code executes, and Azure scales as needed.

何时使用:在你具有由其他 Azure 服务、基于 Web 的事件,或按计划触发的代码的情况下,可以使用 Azure Functions。When to use: Use Azure Functions when you have code that is triggered by other Azure services, by web-based events, or on a schedule. 此外,当你不需要完整托管项目的开销或者只想支付代码运行时间时,也可以使用 Functions。You can also use Functions when you don't need the overhead of a complete hosted project or when you only want to pay for the time that your code runs.

Azure Service FabricAzure Service Fabric

Azure Service Fabric 是一个分布式系统平台,适用于生成、打包、部署和管理可缩放的可靠微服务。Azure Service Fabric is a distributed systems platform that makes it easy to build, package, deploy, and manage scalable and reliable microservices. 它还提供了全面的应用程序管理功能,用于设置、部署、监视、升级/修补和删除部署的应用程序。It also provides comprehensive application management capabilities for provisioning, deploying, monitoring, upgrading/patching, and deleting deployed applications. 在共享计算机池上运行的应用可以从小规模开始,再根据需要扩展为成百上千个计算机。Apps, which run on a shared pool of machines, can start small and scale to hundreds or thousands of machines as needed.

Service Fabric 支持具有 Open Web Interface for .NET (OWIN) 和 ASP.NET Core 的 WebAPI。Service Fabric supports WebAPI with Open Web Interface for .NET (OWIN) and ASP.NET Core. 它提供了用于在 Linux 上使用 .NET Core 和 Java 构建服务的 SDK。It provides SDKs for building services on Linux in both .NET Core and Java. 若要详细了解 Service Fabric,请参阅 Service Fabric 文档To learn more about Service Fabric, see the Service Fabric Documentation.

**何时使用:**如果要创建应用程序或重新编写现有应用程序,以使用微服务体系结构,则 Service Fabric 将是一个不错的选择。When to use: Service Fabric is a good choice when you’re creating an application or rewriting an existing application to use a microservice architecture. 当你需要更好地控制或直接访问底层基础结构时,也可以使用 Service Fabric。Use Service Fabric when you need more control over, or direct access to, the underlying infrastructure.

开始使用:创建第一个 Azure Service Fabric 应用程序Get started: Create your first Azure Service Fabric application.

使用 Azure 服务增强应用程序Enhance your applications with Azure services

除了应用程序托管,Azure 还在云中和本地提供了可以增强应用程序功能、开发和维护的服务产品。In addition to application hosting, Azure provides service offerings that can enhance the functionality, development, and maintenance of your applications, both in the cloud and on-premises.

托管存储和数据访问Hosted storage and data access

大多数应用程序都必须存储数据,因此,无论你决定如何在 Azure 中托管应用程序,都要考虑下面一个或多个存储和数据服务。Most applications must store data, so regardless of how you decide to host your application in Azure, consider one or more of the following storage and data services.

  • Azure SQL 数据库:基于 Azure 版本的 Microsoft SQL Server 引擎,用于在云中存储关系表格数据。Azure SQL Database: An Azure-based version of the Microsoft SQL Server engine for storing relational tabular data in the cloud. SQL 数据库可提供可预测的性能、在不停机情况下进行缩放、业务连续性和数据保护功能。SQL Database provides predictable performance, scalability with no downtime, business continuity, and data protection.

    何时使用:在应用程序需要具有引用完整性、事务支持和 TSQL 查询支持的数据存储时,可以考虑使用。When to use: When your application requires data storage with referential integrity, transactional support, and support for TSQL queries.

    开始使用:使用 Azure 门户在几分钟内创建 SQL 数据库Get started: Create a SQL database in minutes by using the Azure portal.

  • Azure 存储:可针对 blob、队列、文件和其他类型非关系数据提供持久且高可用性的存储。Azure Storage: Offers durable, highly available storage for blobs, queues, files, and other kinds of nonrelational data. 存储服务为 VM 提供了存储基础。Storage provides the storage foundation for VMs.

    何时使用:在应用存储非关系数据,如键值对(表)、blob、文件共享,或消息(队列)的情况下使用。When to use: When your app stores nonrelational data, such as key-value pairs (tables), blobs, files shares, or messages (queues).

    开始使用:选择这些类型存储之一:blob队列文件Get started: Choose from one of these types storage: blobs, tables, queues, or files.

  • Azure DocumentDB:一个完全托管的可缩放 NoSQL 数据库服务,具有对对象数据的 SQL 查询功能。Azure DocumentDB: A fully managed and scalable NoSQL database service, which features SQL queries over object data. 你可以使用现有的 MongoDB 驱动程序来访问 DocumentDB。You can access DocumentDB by using existing MongoDB drivers.

    何时使用:在应用程序需要能够对 JSON 文档执行 SQL 查询,或者在使用 MongoDB 的情况下使用。When to use: When your application needs to be able to execute SQL queries over JSON documents, or if you’re using MongoDB.

    开始使用:构建 DocumentDB C# 控制台应用程序Get started: Build a DocumentDB C# console application. 如果你是 MongoDB 开发人员,请参阅针对 MongoDB 的 DocumentDB 协议支持If you’re a MongoDB developer, see DocumentDB protocol support for MongoDB.

可以使用 Azure 数据工厂将现有的本地数据移到 Azure。You can use Azure Data Factory to move existing on-premises data to Azure. 如果尚未做好将数据移到云中的准备,可以使用 BizTalk 服务中的混合连接将应用服务托管的应用连接到本地资源。If you aren't ready to move data to the cloud, Hybrid Connections in BizTalk Services lets you connect your App Service hosted app to on-premises resources. 此外,你还可以从本地应用程序连接到 Azure 数据和存储服务。You can also connect to Azure data and storage services from your on-premises applications.

Note

Azure 数据工厂和 BizTalk 服务混合连接在中国不可用。Azure Data Factory and BizTalk Services Hybrid Connections are not available in China.

Docker 支持Docker support

Note

Docker 和容器服务在中国不可用。Docker and Container Service are not available in China.

Docker 容器是操作系统虚拟化的一种形式,可让你以更高效且可预见的方式部署应用程序。Docker containers, a form of OS virtualization, let you deploy applications in a more efficient and predictable way. 容器化应用程序在生产环境中的工作方式与在开发和测试系统上的工作方式相同。A containerized application works in production the same way as on your development and test systems. 你可以通过使用标准的 Docker 工具来管理容器。You can manage containers by using standard Docker tools. 可以使用现有技能和常用的开源工具在 Azure 上部署和管理基于容器的应用程序。You can use your existing skills and popular open-source tools to deploy and manage container-based applications on Azure.

Azure 提供了多种方式以便在应用程序中使用容器。Azure provides several ways to use containers in your applications.

  • Azure Docker VM 扩展:允许使用 Docker 工具将虚拟机配置为一个 Docker 主机。Azure Docker VM extension: Lets you configure your VM with Docker tools to act as a Docker host.

    何时使用:当希望在虚拟机上为应用程序生成一致的容器部署,或者当想要使用 Docker Compose 的情况下使用。When to use: When you want to generate consistent container deployments for your applications on a VM, or when you want to use Docker Compose.

  • Azure 容器服务:允许你创建、配置和管理预配置的、以运行容器化应用程序的虚拟机群集。Azure Container Service: Lets you create, configure, and manage a cluster of virtual machines that are preconfigured to run containerized applications.

    何时使用:当需要构建提供其他计划和管理工具的生产就绪、可缩放环境,或者当部署 Docker Swarm 群集时使用。When to use: When you need to build production-ready, scalable environments that provide additional scheduling and management tools, or when you’re deploying a Docker Swarm cluster.

  • Docker 计算机:允许使用 docker 计算机命令安装和管理虚拟主机上的 Docker 引擎。Docker Machine: Lets you install and manage a Docker Engine on virtual hosts by using docker-machine commands.

    何时使用:当需要通过创建一个 Docker 主机快速原型化应用时使用。When to use: When you need to quickly prototype an app by creating a single Docker host.

  • 应用服务的自定义 Docker 映像:在 Linux 上部署 Web 应用时,可以使用容器注册表或客户容器中的 Docker 容器。Custom Docker image for App Service: Lets you use Docker containers from a container registry or a customer container when you deploy a web app on Linux.

    何时使用:在 Linux 上将 Web 应用部署到 Docker 映像时使用。When to use: When deploying a web app on Linux to a Docker image.

身份验证Authentication

重要的是:不仅要知道谁在使用你的应用程序,而且还要防止对资源的未授权访问。It's crucial to not only know who is using your applications, but also to prevent unauthorized access to your resources. Azure 提供了多种方式来对你的应用客户端进行身份验证。Azure provides several ways to authenticate your app clients.

  • Azure Active Directory (Azure AD):Microsoft 基于云的多租户标识和访问管理服务。Azure Active Directory (Azure AD): The Microsoft multitenant, cloud-based identity and access management service. 你可以通过与 Azure AD 集成将单一登录 (SSO) 添加到你的应用程序。You can add single-sign on (SSO) to your applications by integrating with Azure AD. 可以通过直接使用 Azure AD Graph API 或 Microsoft Graph API 访问目录属性。You can access directory properties by using the Azure AD Graph API directly or the Microsoft Graph API. 可以通过使用本机 HTTP/REST 终结点和多平台 Azure AD 身份验证库与支持 OAuth2.0 授权框架的 Azure AD 和 Open ID Connect 相集成。You can integrate with Azure AD support for the OAuth2.0 authorization framework and Open ID Connect by using native HTTP/REST endpoints and the multiplatform Azure AD authentication libraries.

    何时使用:当想要提供 SSO 体验、使用基于图形的数据,或者对基于域的用户进行身份验证时使用。When to use: When you want to provide an SSO experience, work with Graph-based data, or authenticate domain-based users.

    开始使用:若要了解详细信息,请参阅 Azure Active Directory 开发人员指南Get started: To learn more, see the Azure Active Directory developer's guide.

  • 应用服务身份验证:选择应用服务来托管应用时,还会获得对 Azure AD 的内置身份验证支持。App Service Authentication: When you choose App Service to host your app, you also get built-in authentication support for Azure AD.

    何时使用:当想要通过使用 Azure AD、社交标识提供程序或两者来启用应用服务应用中的身份验证时使用。When to use: When you want to enable authentication in an App Service app by using Azure AD, social identity providers, or both.

    开始使用:若要了解有关应用服务中身份验证的详细信息,请参阅 Azure 应用服务中的身份验证和授权Get started: To learn more about authentication in App Service, see Authentication and authorization in Azure App Service.

监视Monitoring

当应用程序在 Azure 中运行时,需要能够监视性能、关注问题,并了解客户使用应用的方式。With your application up and running in Azure, you need to be able to monitor performance, watch for issues, and see how customers are using your app. 为此,Azure 提供了几个监视选项。Azure provides several monitoring options.

  • Visual Studio Application Insights:与 Visual Studio 集成以监视实时 Web 应用的 Azure 托管的可扩展分析服务。Visual Studio Application Insights: An Azure-hosted extensible analytics service that integrates with Visual Studio to monitor your live web applications. 该服务可为你提供需要不断改进应用性能和可用性的数据,无论它们是否托管在 Azure 上。It gives you the data that you need to continuously improve the performance and usability of your apps, whether they’re hosted on Azure or not.

Note

Application Insights 在中国不可用。Application Insights is not available in China.

  • Azure Monitor:这项服务可帮助你对由 Azure 基础结构和资源生成的指标和日志进行可视化、查询、路由、存档,并对其执行操作。Azure Monitor: A service that helps you to visualize, query, route, archive, and act on the metrics and logs that are generated by your Azure infrastructure and resources. 该监视器将提供你在 Azure 门户中看到的数据视图,并且是用于监视 Azure 资源的单一源。Monitor provides the data views that you see in the Azure portal and is a single source for monitoring Azure resources.

DevOps 集成DevOps integration

无论是预配虚拟机还是发布持续集成的 Web 应用,Azure 都将与大部分常用的 DevOps 工具集成。Whether it's provisioning VMs or publishing your web apps with continuous integration, Azure integrates with most of the popular DevOps tools. 在对 Jenkins、GitHub、Puppet、Chef、TeamCity、Ansible、VSTS 以及其他工具的支持下,你可以使用已有工具并在最大程度上提升现有体验。With support for tools like Jenkins, GitHub, Puppet, Chef, TeamCity, Ansible, VSTS, and others, you can work with the tools that you already have and maximize your existing experience.

开始使用:如需查看应用服务应用的 DevOps 选项,请参阅对 Azure 应用服务的持续部署Get started: To see DevOps options for an App Service app, see Continuous Deployment to Azure App Service.

Azure 区域Azure regions

Azure 是一个全球性云平台,在世界各地的许多区域都可以使用。Azure is a global cloud platform that is generally available in many regions around the world. 当你在 Azure 中设置服务、应用程序或虚拟机时,系统将要求你选择一个表示特定数据中心的区域,将在其中运行应用程序或存储数据。When you provision a service, application, or VM in Azure, you are asked to select a region, which represents a specific datacenter where your application runs or where your data is stored. 这些区域对应于在 Azure 区域页上发布的特定位置。These regions correspond to specific locations, which are published on the Azure regions page.

Note

Azure 中国在两个区域可用:中国东部和中国北部。Azure China is available in two regions: China East and China North.

选择应用程序和数据的最佳区域Choose the best region for your application and data

使用 Azure 的好处之一是,你可以将应用程序部署到全球范围内的各种数据中心。One of the benefits of using Azure is that you can deploy your applications to various datacenters around the globe. 你选择的区域可能会影响应用程序的性能。The region that you choose can affect the performance of your application. 例如,最好选择更接近于大部分客户的区域,以减少网络请求中的延迟。For example, it's better to choose a region that’s closer to most of your customers to reduce latency in network requests. 你也可以选择你的地区,以符合在某些国家/地区分发应用的法律要求。You might also want to select your region to meet the legal requirements for distributing your app in certain countries. 最佳的做法是,始终将应用程序数据存储在相同的数据中心,或尽可能靠近托管应用程序的数据中心的数据中心。It's always a best practice to store application data in the same datacenter or in a datacenter as near as possible to the datacenter that is hosting your application.

多区域应用Multi-region apps

尽管整个数据中心可能会因自然灾害或 Internet 故障等事件而脱机,不过这种情况极少发生。Although unlikely, it’s not impossible for an entire datacenter to go offline because of an event such as a natural disaster or Internet failure. 最佳的做法是,将至关重要的业务应用程序托管在多个数据中心,以提供最大的可用性。It’s a best practice to host vital business applications in more than one datacenter to provide maximum availability. 另外,使用多区域也可以减少全球用户的延迟,并在更新应用程序时提供更多的弹性。Using multiple regions can also reduce latency for global users and provide additional opportunities for flexibility when updating applications.

某些服务,如虚拟机和应用服务,使用 Azure 流量管理器启用在两个区域之间进行故障转移的多区域支持,以支持高可用性的企业应用程序。Some services, such as Virtual Machine and App Services, use Azure Traffic Manager to enable multi-region support with failover between regions to support high-availability enterprise applications.

何时使用:当拥有企业和高可用性应用程序受益于故障转移和复制时使用。When to use: When you have enterprise and high-availability applications that benefit from failover and replication.

如何管理我的应用程序和项目?How do I manage my applications and projects?

Azure 提供了一套丰富的体验,可让你同时以编程方式和在 Azure 门户中创建并管理你的 Azure 资源、应用程序和项目。Azure provides a rich set of experiences for you to create and manage your Azure resources, applications, and projects—both programmatically and in the Azure portal.

命令行接口和 PowerShellCommand-line interfaces and PowerShell

Azure 提供了两种方式(通过使用 Bash、终端、命令提示符或你所选的命令行工具)从命令行中管理应用程序和服务。Azure provides two ways to manage your applications and services from the command line by using Bash, Terminal, the command prompt, or your command-line tool of choice. 通常情况下,你可以从命令行执行与在 Azure 门户中一样任务,例如,创建和配置虚拟机、虚拟网络、Web 应用以及其他服务。Usually, you can perform the same tasks from the command line as in the Azure portal—such as creating and configuring virtual machines, virtual networks, web apps, and other services.

  • Azure 命令行接口 (CLI):允许你连接到 Azure 订阅,并从命令行对 Azure 资源计划各种任务。Azure Command-Line Interface (CLI): Lets you connect to an Azure subscription and program various tasks against Azure resources from the command line.

  • Azure PowerShell:提供了一组带 cmdlet 的模块,可让你通过使用 Windows PowerShell 来管理 Azure 资源。Azure PowerShell: Provides a set of modules with cmdlets that enable you to manage Azure resources by using Windows PowerShell.

Azure 门户Azure portal

Azure 门户是一个基于 Web 的应用程序,可用于创建、管理和删除 Azure 资源及服务。The Azure portal is a web-based application that you can use to create, manage, and remove Azure resources and services. Azure 门户位于 https://portal.azure.cnThe Azure portal is located at https://portal.azure.cn. 它包括可自定义的仪表板、用于管理 Azure 资源的工具,以及对订阅设置和计费信息的访问权限。It includes a customizable dashboard, tools for managing Azure resources, and access to subscription settings and billing information. 有关详细信息,请参阅 Azure 门户概述For more information, see the Azure portal overview.

REST APIREST APIs

Azure 是基于一组支持 Azure 门户 UI 的 REST API 构建的。Azure is built on a set of REST APIs that support the Azure portal UI. 其中大多数 REST API 还支持通过编程方式设置和管理来自任何启用 Internet 设备的 Azure 资源和应用程序。Most of these REST APIs are also supported to let you programmatically provision and manage your Azure resources and applications from any Internet-enabled device. 有关完整的 REST API 文档集,请参阅 Azure REST SDK 参考For the complete set of REST API documentation, see the Azure REST SDK reference.

APIAPIs

除了 REST API,许多 Azure 服务还允许以编程方式管理应用程序中的资源,方法是通过使用特定于平台的 Azure SDK,包括用于以下开发平台的 SDK:In addition to REST APIs, many Azure services also let you programmatically manage resources from your applications by using platform-specific Azure SDKs, including SDKs for the following development platforms:

移动应用Azure 媒体服务等服务均提供客户端 SDK,可让你从 Web 和移动客户端应用访问服务。Services such as Mobile Apps and Azure Media Services provide client-side SDKs to let you access services from web and mobile client apps.

Azure 资源管理器Azure Resource Manager

在 Azure 上运行应用可能需要使用多个 Azure 服务,所有这些服务都遵循相同的生命周期,并且可以被视为一个逻辑单元。Running your app on Azure likely involves working with multiple Azure services, all of which follow the same life cycle and can be thought of as a logical unit. 例如,Web 应用可以使用 Web 应用、SQL 数据库、存储、Azure Redis 缓存,以及 Azure 内容交付网络服务。For example, a web app might use Web Apps, SQL Database, Storage, Azure Redis Cache, and Azure Content Delivery Network services. Azure 资源管理器能够使你以组的方式处理应用程序中的资源。Azure Resource Manager lets you work with the resources in your application as a group. 你可以通过单个协调的操作来部署、更新或删除所有资源。You can deploy, update, or delete all the resources in a single, coordinated operation.

除了逻辑分组和管理相关的资源外,Azure 资源管理器还包括可让你自定义相关资源部署和配置的部署功能。In addition to logically grouping and managing related resources, Azure Resource Manager includes deployment capabilities that let you customize the deployment and configuration of related resources. 例如,通过使用资源管理器,你可以将包含多个虚拟机、负载均衡器和 Azure SQL 数据库的应用程序作为单一单元进行部署和配置。For example, by using Resource Manager, you can deploy and configure an application that consists of multiple virtual machines, a load balancer, and an Azure SQL database as a single unit.

你可以通过使用 Azure 资源管理器模板(以 JSON 格式化的文档)来开发这些部署。You develop these deployments by using an Azure Resource Manager template, which is a JSON-formatted document. 使用这些模板,可让你通过使用声明性模板(而不是脚本)来定义应用程序的部署和管理。Templates let you define a deployment and manage your applications by using declarative templates, rather than scripts. 模板可用于测试、过渡和生产等不同的环境。Your templates can work for different environments, such as testing, staging, and production. 例如,通过使用模板,可将一个按钮添加到 GitHub 存储库,然后只需单击一下即可将存储库中的代码部署到一组 Azure 服务中。For example, by using templates, you can add a button to a GitHub repo that deploys the code in the repo to a set of Azure services with a single click.

何时使用:在希望对通过使用 REST API、Azure CLI 和 Azure PowerShell 以编程方式进行管理的应用执行基于模板的部署时,可以使用资源管理器模板。When to use: Use Resource Manager templates when you want a template-based deployment for your app that you can manage programmatically by using REST APIs, the Azure CLI, and Azure PowerShell.

开始使用:若要开始使用模板,请参阅创作 Azure 资源管理器模板Get started: To get started using templates, see Authoring Azure Resource Manager templates.