使用服务和生成应用时 Azure Stack Hub 与 Azure 之间的差异Differences between Azure Stack Hub and Azure when using services and building apps

使用 Azure Stack Hub 的服务或开发适用于 Azure Stack Hub 的应用之前,必须了解 Azure Stack Hub 与 Azure 之间的差异。Before you use services or build apps for Azure Stack Hub, it's important to understand the differences between Azure Stack Hub and Azure. 本文阐述在将 Azure Stack Hub 用作混合云开发环境时的不同功能和重要注意事项。This article identifies different features and key considerations when using Azure Stack Hub as your hybrid cloud development environment.

概述Overview

Azure Stack Hub 是一个混合云平台,可用于通过公司或服务提供商的数据中心使用 Azure 服务。Azure Stack Hub is a hybrid cloud platform that enables you to use Azure services from your company or service provider datacenter. 可在 Azure Stack Hub 上开发应用,然后将其部署到 Azure Stack Hub、Azure 或 Azure 混合云。You can build an app on Azure Stack Hub and then deploy it to Azure Stack Hub, to Azure, or to your Azure hybrid cloud.

Azure Stack Hub 运营商会告知有哪些服务可供你使用,以及如何获取支持。Your Azure Stack Hub operator tells you which services are available for you to use, and how to get support. 他们通过自定义计划和套餐来提供这些服务。They offer these services through their customized plans and offers.

Azure 技术文档内容假设应用是为 Azure 服务(而不是 Azure Stack Hub)开发的。The Azure technical documentation content assumes that apps are being developed for an Azure service and not for Azure Stack Hub. 开发应用并将其部署到 Azure Stack Hub 时,必须了解一些主要差异,例如:When you build and deploy apps to Azure Stack Hub, you must understand some key differences, such as:

  • Azure Stack Hub 提供 Azure 所提供的一部分服务和功能。Azure Stack Hub delivers a subset of the services and features that are available in Azure.
  • 你的公司或服务提供商可以选择他们想要提供的服务。Your company or service provider can choose which services they want to offer. 可用的选项可能包括自定义的服务或应用程序。The available options might include customized services or applications. 他们可以提供自己的自定义文档。They may offer their own customized documentation.
  • 使用正确的 Azure Stack Hub 特定终结点(例如,门户地址和 Azure 资源管理器终结点的 URL)。Use the correct Azure Stack Hub-specific endpoints (for example, the URLs for the portal address and the Azure Resource Manager endpoint).
  • 必须使用 Azure Stack Hub 支持的 PowerShell 和 API 版本。You must use PowerShell and API versions that are supported by Azure Stack Hub. 使用支持的版本可确保应用在 Azure Stack Hub 和 Azure 中运行。Using supported versions ensures that your apps work in both Azure Stack Hub and Azure.

速查表:大致差异Cheat sheet: High-level differences

下表描述了 Azure Stack Hub 与 Azure 之间的大致差异。The following table describes the high-level differences between Azure Stack Hub and Azure. 针对 Azure Stack Hub 进行开发或使用 Azure Stack Hub 服务时,请记住这些差异:Keep these differences in mind when you develop for Azure Stack Hub or use Azure Stack Hub services:

区域Area Azure(中国)Azure (China) Azure Stack HubAzure Stack Hub
由谁运营?Who operates it? 世纪互联21vianet 你的组织或服务提供商。Your organization or service provider.
寻求支持的联系对象是谁?Who do you contact for support? AzureAzure 对于集成环境,请联系你的组织或服务提供商的 Azure Stack Hub 运营商来获取支持。For an integrated system, contact your Azure Stack Hub operator (at your organization or service provider) for support.

如需获取 Azure Stack Hub 开发工具包 (ASDK) 支持,请访问 Azure 论坛For Azure Stack Development Kit (ASDK) support, visit the Azure forums. 由于开发工具包是一个评估环境,因此我们不会通过 Azure 支持提供官方支持。Because the development kit is an evaluation environment, there's no official support offered through Azure Support.
可用服务Available services 参阅 Azure 产品列表。See the list of Azure products. 可用服务因 Azure 区域而异。Available services vary by Azure region. Azure Stack Hub 支持部分 Azure 服务。Azure Stack Hub supports a subset of Azure services. 实际服务因你的组织或服务提供商选择提供的服务而异。Actual services will vary based on what your organization or service provider chooses to offer.
Azure 资源管理器终结点*Azure Resource Manager endpoint* https://management.chinacloudapi.cn 对于 Azure Stack Hub 集成系统,请使用 Azure Stack Hub 操作员提供的终结点。For an Azure Stack Hub integrated system, use the endpoint that your Azure Stack Hub operator provides.

对于开发工具包,请使用 https://management.local.azurestack.externalFor the development kit, use: https://management.local.azurestack.external.
门户 URL*Portal URL* https://portal.azure.cn 对于 Azure Stack Hub 集成系统,请使用 Azure Stack Hub 操作员提供的 URL。For an Azure Stack Hub integrated system, use the URL that your Azure Stack Hub operator provides.

对于开发工具包,请使用 https://portal.local.azurestack.externalFor the development kit, use: https://portal.local.azurestack.external.
区域Region 可以选择要部署到的区域。You can select which region you want to deploy to. 对于 Azure Stack Hub 集成系统,请使用系统中可用的区域。For an Azure Stack Hub integrated system, use the region that's available on your system.

对于 Azure Stack 开发工具包 (ASDK),该区域始终为“本地”。For the Azure Stack Development Kit (ASDK), the region will always be local.
资源组Resource groups 资源组可以跨区域。A resource group can span regions. 对于集成系统和开发工具包,只有一个区域。For both integrated systems and the development kit, there's only one region.
支持的命名空间、资源类型和 API 版本Supported namespaces, resource types, and API versions 最新版本(或未弃用的较低版本)。The latest (or earlier versions that aren't yet deprecated). Azure Stack Hub 支持特定的版本。Azure Stack Hub supports specific versions. 请参阅本文的版本要求部分。See the Version requirements section of this article.

*如果你是 Azure Stack Hub 操作员,请参阅使用管理员门户管理基础知识来了解详细信息。*If you're an Azure Stack Hub operator, see Using the administrator portal and Administration basics for more information.

有用的工具和最佳做法Helpful tools and best practices

Azure 提供的工具和指导有助于 Azure Stack Hub 方面的开发。Azure provides tools and guidance that help you develop for Azure Stack Hub.

建议Recommendation 参考References
在开发人员工作站上安装正确的工具。Install the correct tools on your developer workstation. - 安装 PowerShell- Install PowerShell
- 下载工具- Download tools
- 配置 PowerShell- Configure PowerShell
- 安装 Visual Studio- Install Visual Studio
查看有关以下各项的信息:Review information about the following items:
Azure 资源管理器模板注意事项。- Azure Resource Manager template considerations.
- 如何查找快速入门模板。- How to find quickstart templates.
- 借助策略模块使用 Azure 进行 Azure Stack Hub 方面的开发。- Use a policy module to help you use Azure to develop for Azure Stack Hub.
为 Azure Stack Hub 进行开发Develop for Azure Stack Hub
查看并遵循模板最佳做法。Review and follow the best practices for templates. 资源管理器快速入门模板Resource Manager Quickstart Templates

版本要求Version requirements

Azure Stack Hub 支持特定版本的 Azure PowerShell 和 Azure 服务 API。Azure Stack Hub supports specific versions of Azure PowerShell and Azure service APIs. 使用支持的版本,确保可将应用部署到 Azure Stack Hub 和 Azure。Use supported versions to ensure that your app can deploy to both Azure Stack Hub and to Azure.

若要确保使用正确版本的 Azure PowerShell,请使用 API 版本配置文件To make sure that you use a correct version of Azure PowerShell, use API version profiles. 若要确定可以使用的最新 API 版本配置文件,请找出使用的 Azure Stack Hub 内部版本。To determine the latest API version profile that you can use, find out the build of Azure Stack Hub you're using. 可以从 Azure Stack Hub 管理员获取此信息。You can get this information from your Azure Stack Hub administrator.

备注

如果使用 Azure Stack 开发工具包,并且拥有管理访问权限,请参阅确定当前版本部分来确定 Azure Stack Hub 内部版本。If you're using the Azure Stack Development Kit, and you have administrative access, see the Determine the current version section to determine the Azure Stack Hub build.

对于其他 API,请运行以下 PowerShell 命令输出 Azure Stack Hub 订阅中支持的命名空间、资源类型和 API 版本(在属性级别上可能仍然存在差异)。For other APIs, run the following PowerShell command to output the namespaces, resource types, and API versions that are supported in your Azure Stack Hub subscription (there may still be differences at a property level). 若要正常运行此命令,必须事先安装配置适用于 Azure Stack Hub 环境的 PowerShell。For this command to work, you must have already installed and configured PowerShell for an Azure Stack Hub environment. 此外,必须有 Azure Stack Hub 套餐的订阅。You must also have a subscription to an Azure Stack Hub offer.

Get-AzureRmResourceProvider | Select ProviderNamespace -Expand ResourceTypes | Select * -Expand ApiVersions | `
Select ProviderNamespace, ResourceTypeName, @{Name="ApiVersion"; Expression={$_}} 

示例输出(已截断):Get-AzureRmResourceProvider 命令的示例输出Example output (truncated): Example output of Get-AzureRmResourceProvider command

后续步骤Next steps

有关服务级别的差异的详细信息,请参阅:For more detailed information about differences at a service level, see: