Azure Spring Cloud 常见问题解答Azure Spring Cloud FAQ

本文解答有关 Azure Spring Cloud 的常见问题。This article answers frequently asked questions about Azure Spring Cloud.

常规General

为何要使用 Azure Spring Cloud?Why Azure Spring Cloud?

Azure Spring Cloud 为 Spring Cloud 开发人员提供平台即服务 (PaaS)。Azure Spring Cloud provides a platform as a service (PaaS) for Spring Cloud developers. Azure Spring Cloud 可以管理应用程序基础结构,使你能够专注于应用程序代码和业务逻辑。Azure Spring Cloud manages your application infrastructure so that you can focus on application code and business logic. Azure Spring Cloud 中内置的核心功能包括 Eureka、配置服务器、服务注册表服务器、Pivotal Build Service、蓝绿部署,等等。Core features built into Azure Spring Cloud include Eureka, Config Server, Service Registry Server, Pivotal Build Service, Blue-green deployment, and more. 此服务还可让开发人员将其应用程序绑定到 Azure Cosmos DB、 Azure Database for MySQL 和 Azure Cache for Redis 等其他 Azure 服务。This service also enables developers to bind their applications with other Azure services, such as Azure Cosmos DB, Azure Database for MySQL, and Azure Cache for Redis.

Azure Spring Cloud 通过集成 Azure Monitor、Application Insights 和 Log Analytics 来增强开发人员和运营商的应用程序诊断体验。Azure Spring Cloud enhances the application diagnostics experience for developers and operators by integrating Azure Monitor, Application Insights, and Log Analytics.

Azure Spring Cloud 的安全性如何?How secure is Azure Spring Cloud?

安全性和隐私性是 Azure 及 Azure Spring Cloud 客户最关注的问题之一。Security and privacy are among the top priorities for Azure and Azure Spring Cloud customers. Azure 将会安全加密所有应用程序数据、日志或配置,有助于确保只有各自的客户才能访问这些数据。Azure helps ensure that only customers have access to application data, logs, or configurations by securely encrypting all of this data.

  • Azure Spring Cloud 中的服务实例彼此隔离。The service instances in Azure Spring Cloud are isolated from each other.
  • Azure Spring Cloud 提供完整的 TLS/SSL 和证书管理。Azure Spring Cloud provides complete TLS/SSL and certificate management.
  • 适用于 OpenJDK 和 Spring Cloud 运行时的关键安全修补程序会尽快应用到 Azure Spring Cloud。Critical security patches for OpenJDK and Spring Cloud runtimes are applied to Azure Spring Cloud as soon as possible.

是否有客户数据存储在指定区域之外?Is any customer data stored outside of the specified region?

Azure Spring Cloud 是一种区域服务。Azure Spring Cloud is a regional service. Azure Spring Cloud 中的所有客户数据都存储在指定区域的同一地区内的多个区域,以实现冗余。All customer data in Azure Spring Cloud is stored to multiple regions within the same geo of the specified region for redundancy. 若要了解有关地区和区域的详细信息,请参阅 Azure 中的数据驻留To learn more about geo and region, see Data residency in Azure.

Azure Spring Cloud 有哪些已知限制?What are the known limitations of Azure Spring Cloud?

Azure Spring Cloud 有以下已知限制:Azure Spring Cloud has the following known limitations:

  • 用于创建每个应用程序的应用程序名称将会覆盖 spring.application.namespring.application.name will be overridden by the application name that's used to create each application.
  • server.port 默认设置为端口 1025。server.port defaults to port 1025. 如果应用其他任何值,则该值将被替代。If any other value is applied, it will be overridden. 请遵从此设置,不要在代码中指定服务器端口。Please also respect this setting and not specify server port in your code.
  • Azure 门户和 Azure 资源管理器模板不支持上传应用程序包。The Azure portal and Azure Resource Manager templates do not support uploading application packages. 如需上传应用程序包,仅可通过 Azure CLI 部署应用程序。You can upload application packages only by deploying the application via the Azure CLI.

有哪些定价层可用?What pricing tiers are available?

我应使用哪一种?每个层中的限制是什么?Which one should I use and what are the limits within each tier?

  • Azure Spring Cloud 提供两个定价层:“基本”和“标准”。Azure Spring Cloud offers two pricing tiers: Basic and Standard. 基本层面向开发/测试和试用 Azure Spring Cloud。The Basic tier is targeted for Dev/Test and trying out Azure Spring Cloud. 标准层经过优化,可运行常规用途生产流量。The Standard tier is optimized to run general purpose production traffic. 有关限制和功能级别的比较,请参阅 Azure Spring Cloud 定价详细信息See Azure Spring Cloud pricing details for limits and feature level comparison.

如何提供反馈和报告问题?How can I provide feedback and report issues?

如果遇到 Azure Spring Cloud 的问题,请创建 Azure 支持请求。If you encounter any issues with Azure Spring Cloud, create an Azure Support Request. 若要提交功能请求或提供反馈,请参阅 Azure 反馈To submit a feature request or provide feedback, go to Azure Feedback.

开发Development

我是一名 Spring Cloud 开发人员,但不熟悉 Azure。I am a Spring Cloud developer but new to Azure. 能够最快帮助我了解如何开发 Azure Spring Cloud 应用程序的方法是什么?What is the quickest way for me to learn how to develop an Azure Spring Cloud application?

如需了解开始使用 Azure Spring Cloud 的最快方法,请遵循快速入门:通过使用 Azure 门户启动 Azure Spring Cloud 应用程序中的说明。For the quickest way to get started with Azure Spring Cloud, follow the instructions in Quickstart: Launch an Azure Spring Cloud application by using the Azure portal.

Azure Spring Cloud 支持哪些 Java 运行时?What Java runtime does Azure Spring Cloud support?

Azure Spring Cloud 支持 Java 8 和 11。Azure Spring Cloud supports Java 8 and 11. 请参阅 Java 运行时和操作系统版本See Java runtime and OS versions

在哪里可以查看 Spring Cloud 应用程序日志和指标?Where can I view my Spring Cloud application logs and metrics?

在“应用概述”选项卡和“Azure Monitor”选项卡中可以找到指标。Find metrics in the App Overview tab and the Azure Monitor tab.

Azure Spring Cloud 支持将 Spring Cloud 应用程序日志和指标导出到 Azure 存储、事件中心和 Log AnalyticsAzure Spring Cloud supports exporting Spring Cloud application logs and metrics to Azure Storage, EventHub, and Log Analytics. Log Analytics 中的表名称是 AppPlatformLogsforSpring。The table name in Log Analytics is AppPlatformLogsforSpring. 若要了解如何启用它,请参阅诊断服务To learn how to enable it, see Diagnostic services.

Azure Spring Cloud 是否支持分布式跟踪?Does Azure Spring Cloud support distributed tracing?

是的。Yes. 有关详细信息,请参阅教程:将分布式跟踪与 Azure Spring Cloud 配合使用For more information, see Tutorial: Use Distributed Tracing with Azure Spring Cloud.

服务绑定支持哪些资源类型?What resource types does Service Binding support?

目前支持三个服务:Three services are currently supported:

  • Azure Cosmos DBAzure Cosmos DB
  • Azure Database for MySQLAzure Database for MySQL
  • Azure Redis 缓存。Azure Cache for Redis.

是否可以从应用程序内部查看、添加或移动永久性卷?Can I view, add, or move persistent volumes from inside my applications?

是的。Yes.

Azure Spring Cloud 实例有多少出站公共 IP 地址?How many outbound public IP addresses does an Azure Spring Cloud instance have?

出站公共 IP 地址数可能因层级和其他因素而异。The number of outbound public IP addresses may vary according to the tiers and other factors.

Azure Spring Cloud 实例类型Azure Spring Cloud instance type 默认的出站公共 IP 地址数Default number of outbound public IP addresses
基本层实例Basic Tier instances 11
标准层实例Standard Tier instances 22
VNet 注入实例VNet injection instances 11

是否可以增加出站公共 IP 地址的数量?Can I increase the number of outbound public IP addresses?

是,你可以提交支持票证以请求更多出站公共 IP 地址。Yes, you can open a support ticket to request for more outbound public IP addresses.

删除/移动 Azure Spring Cloud 服务实例时,是否也会删除/移动其扩展资源?When I delete/move an Azure Spring Cloud service instance, will its extension resources be deleted/moved as well?

这取决于拥有扩展资源的资源提供程序的逻辑。It depends on the logic of resource providers that own the extension resources. Microsoft.AppPlatform 实例的扩展资源不属于同一命名空间,因此行为因资源提供程序而异。The extension resources of a Microsoft.AppPlatform instance do not belong to the same namespace, so the behavior varies by resource provider. 例如,删除/移动操作不会级联到诊断设置资源。For example, the delete/move operation will not cascade to the diagnostics settings resources. 如果为新的 Azure Spring Cloud 实例预配了与已删除实例相同的资源 ID,或者将以前的 Azure Spring Cloud 实例移回,则先前的诊断设置资源将继续对其进行扩展。If a new Azure Spring Cloud instance is provisioned with the same resource ID as the deleted one, or if the previous Azure Spring Cloud instance is moved back, the previous diagnostics settings resources continue extending it.

可以使用 Azure CLI 删除 Spring Cloud 的诊断设置:You can delete Spring Cloud's diagnostic settings by using Azure CLI:

 az monitor diagnostic-settings delete --name $diagnosticSettingName --resource $azureSpringCloudResourceId

Java 运行时和操作系统版本Java runtime and OS versions

Azure Spring Cloud 中支持哪些版本的 Java 运行时?Which versions of Java runtime are supported in Azure Spring Cloud?

Azure Spring Cloud 支持具有最新内部版本的 Java LTS 版本,当前支持的版本为 2020年 6 月版本、java 8 和 Java 11。Azure Spring Cloud supports Java LTS versions with the most recent builds, currently June 2020, Java 8 and Java 11 are supported. 请参阅安装适用于 Azure 和 Azure Stack 的 JDKSee Install the JDK for Azure and Azure Stack

谁构建了这些 Java 运行时?Who built these Java runtimes?

Azul 系统。Azul Systems. Azul Zulu for Azure - Enterprise Edition 内部版 JDK 是适用于 Azure 和 Azure Stack 的 OpenJDK 的免费、多平台、生产就绪型发行版,由 Microsoft 及 Azul Systems 提供支持。The Azul Zulu for Azure - Enterprise Edition JDK builds are a no-cost, multi-platform, production-ready distribution of the OpenJDK for Azure and Azure Stack backed by Microsoft and Azul Systems. 这些版本包含构建和运行 Java SE 应用程序所需的所有组件。They contain all the components for building and running Java SE applications.

Java 运行时多久更新一次?How often will Java runtimes get updated?

这些 LTS 和 MTS JDK 版本提供季度安全更新程序和 Bug 修补程序,并根据需要提供关键的带外更新和修补程序。LTS and MTS JDK releases have quarterly security updates, bug fixes, and critical out-of-band updates and patches as needed. 此支持包括更新版 Java(例如 Java 11)中报告的针对 Java 7 和 8 的安全更新和 Bug 修复的后向移植。This support includes backports to Java 7 and 8 of security updates and bug fixes reported in newer versions of Java, like Java 11.

Java 8 和 Java 11 LTS 版本将受到多长时间的支持?How long will Java 8 and Java 11 LTS versions be supported?

请参阅针对 Azure 和 Azure Stack 的 Java 长期支持See Java long-term support for Azure and Azure Stack.

  • 对 Java 8 LTS 的支持将持续至 2030 年 12 月。Java 8 LTS will be supported until December 2030.
  • 对 Java 11 LTS 的支持将持续至 2027 年 9 月。Java 11 LTS will be supported until September 2027.

如何下载本地开发支持的 Java 运行时?How can I download a supported Java runtime for local development?

请参阅安装适用于 Azure 和 Azure Stack 的 JDKSee Install the JDK for Azure and Azure Stack.

对于较旧的 Java 运行时,停用策略是什么?What is the retire policy for older Java runtimes?

公开通知将在旧的运行时版本停用之前 12 个月发出。Public notice will be sent out at 12 months before any old runtime version is retired. 你可以在 12 个月内迁移到更高版本。You will have 12 months to migrate to a later version.

  • 订阅管理员将在我们停用 Java 版本时收到电子邮件通知。Subscription admins will get email notification when we will retire a Java version.
  • 停用信息将在文档中发布。The retire information will be published in the documentation.

运行应用的操作系统是什么?What is the operation system to run my apps?

操作系统使用最新的 Ubuntu LTS 版本,目前 Ubuntu 20.04 LTS (Focal Fossa) 是默认操作系统。The most recent Ubuntu LTS version is used, currently Ubuntu 20.04 LTS (Focal Fossa) is the default OS.

操作系统安全修补程序多久应用一次?How often are OS security patches applied?

适用于 Azure Spring Cloud 的安全修补程序每月向生产环境推出。Security patches applicable to Azure Spring Cloud are rolled out to production on a monthly basis. 适用于 Azure Spring Cloud 的关键安全修补程序(CVE 评分 > = 9)将尽快推出。Critical security patches (CVE score >= 9) applicable to Azure Spring Cloud are rolled out as soon as possible.

部署Deployment

Azure Spring Cloud 是否支持蓝绿部署?Does Azure Spring Cloud support blue-green deployment?

是的。Yes. 有关详细信息,请参阅设置过渡环境For more information, see Set up a staging environment.

是否可以访问 Kubernetes 来操作应用程序容器?Can I access Kubernetes to manipulate my application containers?

不是。No. Azure Spring Cloud 可使开发人员抽身于底层体系结构,将注意力放在应用程序代码和业务逻辑上。Azure Spring Cloud abstracts the developer from the underlying architecture, allowing you to concentrate on application code and business logic.

Azure Spring Cloud 是否支持从源构建容器?Does Azure Spring Cloud support building containers from source?

是的。Yes. 有关详细信息,请参阅 从源代码启动 Spring Cloud 应用程序For more information, see Launch your Spring Cloud application from source code.

Azure Spring Cloud 是否支持应用实例中的自动缩放?Does Azure Spring Cloud support autoscaling in app instances?

是的。Yes. 有关详细信息,请参阅设置自动缩放For more information, see Setup autoscale.

将现有 Spring Cloud 微服务迁移到 Azure Spring Cloud 的最佳做法是什么?What are the best practices for migrating existing Spring Cloud microservices to Azure Spring Cloud?

在将现有 Spring Cloud 微服务迁移到 Azure Spring Cloud 时,最好遵循以下最佳做法:As you're migrating existing Spring Cloud microservices to Azure Spring Cloud, it's a good idea to observe the following best practices:

  • 需要解析所有应用程序依赖项。All application dependencies need to be resolved.
  • 准备好配置项、环境变量和 JVM 参数,以便可将其与 Azure Spring Cloud 中的部署进行比较。Prepare your configuration entries, environment variables, and JVM parameters so that you can compare them with the deployment in Azure Spring Cloud.
  • 若要使用服务绑定,请分析你的 Azure 服务,并确保设置适当的访问权限。If you want to use Service Binding, go through your Azure services and ensure that you've set the appropriate access permissions.
  • 我们建议删除或禁用可能与 Azure Spring Cloud 管理的服务(例如,我们的服务发现服务、配置服务器等)相冲突的嵌入式服务。We recommend that you remove or disable any embedded services that might conflict with services that are managed by Azure Spring Cloud, such as our Service Discovery service, Config Server, and so on.
  • 我们建议使用官方的、稳定的 Pivotal Spring 库。We recommend that you use official, stable Pivotal Spring libraries. 非正式版、beta 版或克隆版的 Pivotal Spring 库不附带服务级别协议 (SLA) 支持。Unofficial, beta, or forked versions of Pivotal Spring libraries have no service-level agreement (SLA) support.

迁移后,请监视 CPU/RAM 指标和网络流量,以确保适当缩放应用程序实例。After the migration, monitor your CPU/RAM metrics and network traffic to ensure that the application instances are scaled appropriately.

疑难解答Troubleshooting

极少发生的服务注册表不可用情况会产生什么影响?What are the impacts of service registry rarely unavailable?

在一些极少发生的情况下,你可能会看到一些错误,例如In some rarely happened scenario, you may see some errors like

RetryableEurekaHttpClient: Request execution failure with status code 401; retrying on another server if available

在应用程序的日志中。from your logs of applications. 这种极少出现的由 Spring 框架引入的问题是由网络不稳定或其他网络问题导致的。This issue introduced by spring framework with very low rate due to network unstable or other network issues.

这应该不会对用户体验产生影响,eureka 客户端具有检测信号和重试策略来解决此问题。There should be no impacts to user experience, eureka client has both heartbeat and retry policy to take care of this. 可以将它视为一个暂时性错误,放心地忽略它。You could consider it as one transient error and skip it safely.

我们将在不久的将来增强这方面,避免用户的应用程序中出现此错误。We will enhance this part and avoid this error from users’ applications in short future.

后续步骤Next steps

如果有其他问题,请参阅 Azure Spring Cloud 故障排除指南If you have further questions, see the Azure Spring Cloud troubleshooting guide.