排查云服务部署问题Troubleshoot cloud service deployment problems

将云服务应用程序包部署到 Azure 时,可通过 Azure 门户中的“属性” 窗格获取有关部署的信息。When you deploy a cloud service application package to Azure, you can obtain information about the deployment from the Properties pane in the Azure portal. 可以使用此窗格中的详细信息来帮助解决云服务的问题,还可以在提交新的支持请求时将此信息提供给 Azure 支持人员。You can use the details in this pane to help you troubleshoot problems with the cloud service, and you can provide this information to Azure Support when opening a new support request.

可按如下所述找到“属性” 窗格:You can find the Properties pane as follows:

  • 在 Azure 门户中,依次单击云服务的部署、“所有设置”、“属性”。In the Azure portal, click the deployment of your cloud service, click All settings, and then click Properties.

备注

可以通过单击“属性”窗格右上角的图标将该窗格的内容复制到剪贴板。You can copy the contents of the Properties pane to the clipboard by clicking the icon in the upper-right corner of the pane.

如果本文未解决你的 Azure 问题,请访问 MSDN 和 CSDN 上的 Azure 论坛。If your Azure issue is not addressed in this article, visit the Azure forums on MSDN and CSDN. 可以在这些论坛上发布问题。You can post your issue in these forums. 还可提交 Azure 支持请求。You also can submit an Azure support request. 若要提交支持请求,请在 Azure 支持页上提交。To submit a support request, on the Azure support page.

问题:无法访问网站,但部署已启动且所有角色实例均已就绪Problem: I cannot access my website, but my deployment is started and all role instances are ready

门户中显示的网站 URL 链接不包括该端口。The website URL link shown in the portal does not include the port. 网站的默认端口为 80。The default port for websites is 80. 如果应用程序已配置为在其他端口中运行,则必须在访问网站时向 URL 添加正确的端口号。If your application is configured to run in a different port, you must add the correct port number to the URL when accessing the website.

  1. 在 Azure 门户中,单击云服务的部署。In the Azure portal, click the deployment of your cloud service.
  2. 在 Azure 门户的“属性”窗格中,检查角色实例(位于“输入终结点”下)的端口。In the Properties pane of the Azure portal, check the ports for the role instances (under Input Endpoints).
  3. 如果端口不是 80,请在访问应用程序时将正确的端口值添加到 URL。If the port is not 80, add the correct port value to the URL when you access the application. 若要指定非默认端口,请键入 URL,后跟冒号 (:) 以及端口号(无空格)。To specify a non-default port, type the URL, followed by a colon (:), followed by the port number, with no spaces.

问题:我的角色实例在我未执行任何操作的情况下被回收Problem: My role instances recycled without me doing anything

Azure 检测到问题节点并因此将角色实例移到新节点时,系统会自动进行服务修复。Service healing occurs automatically when Azure detects problem nodes and therefore moves role instances to new nodes. 发生这种情况时,可能会看到角色实例自动回收。When this occurs, you might see your role instances recycling automatically. 若要查看是否进行了服务修复,请执行以下操作:To find out if service healing occurred:

  1. 在 Azure 门户中,单击云服务的部署。In the Azure portal, click the deployment of your cloud service.
  2. 在 Azure 门户的“属性” 窗格中查看相关信息,并确定观察到角色回收期间是否进行了服务修复。In the Properties pane of the Azure portal, review the information and determine whether service healing occurred during the time that you observed the roles recycling.

在主机 OS 和来宾 OS 更新期间,角色也会差不多每月回收一次。Roles will also recycle roughly once per month during host-OS and guest-OS updates.
有关详细信息,请参阅博客文章 因 OS 升级导致的角色实例重启For more information, see the blog post Role Instance Restarts Due to OS Upgrades

问题:无法进行 VIP 交换并收到错误Problem: I cannot do a VIP swap and receive an error

如果部署更新正在进行,则不能进行 VIP 交换。A VIP swap is not allowed if a deployment update is in progress. 出现以下情况时,部署更新可能会自动进行:Deployment updates can occur automatically when:

  • 新的来宾操作系统已发布,而已配置为自动进行更新。A new guest operating system is available and you are configured for automatic updates.
  • 进行了服务修复。Service healing occurs.

要了解是否是自动更新阻止你执行 VIP 交换,请执行以下操作:To find out if an automatic update is preventing you from doing a VIP swap:

  1. 在 Azure 门户中,单击云服务的部署。In the Azure portal, click the deployment of your cloud service.
  2. 在 Azure 门户的“属性”窗格中,查看“状态”的值。In the Properties pane of the Azure portal, look at the value of Status. 如果状态为“就绪”,则请检查“上次操作”,查看最近是否进行了更新,因为更新可能会阻止执行 VIP 交换。If it is Ready, then check Last operation to see if one recently happened that might prevent the VIP swap.
  3. 重复进行生产部署所需的步骤 1 和步骤 2。Repeat steps 1 and 2 for the production deployment.
  4. 如果自动更新正在进行,则请等待其完成,再尝试进行 VIP 交换。If an automatic update is in process, wait for it to finish before trying to do the VIP swap.

问题:角色实例在“已启动”、“正在初始化”、“忙碌”和“已停止”这几种状态之间循环往复Problem: A role instance is looping between Started, Initializing, Busy, and Stopped

这种情况可能指示应用程序代码、程序包或配置文件存在问题。This condition could indicate a problem with your application code, package, or configuration file. 在这种情况下,应能看到状态每隔几分钟更改一次,而 Azure 门户则可能会显示“正在回收”、“忙”或“正在初始化”之类的内容。In that case, you should be able to see the status changing every few minutes and the Azure portal may say something like Recycling, Busy, or Initializing. 这表示应用程序存在问题,导致角色实例无法运行。This indicates that there is something wrong with the application that is keeping the role instance from running.

有关如何解决此问题的详细信息,请参阅博客文章 Azure PaaS Compute Diagnostics Data(Azure PaaS 计算诊断数据)和导致角色回收的常见问题For more information on how to troubleshoot for this problem, see the blog post Azure PaaS Compute Diagnostics Data and Common issues that cause roles to recycle.

问题:我的应用程序停止工作Problem: My application stopped working

  1. 在 Azure 门户中,单击角色实例。In the Azure portal, click the role instance.
  2. 在 Azure 门户的“属性” 窗格中,考虑是否存在以下情况,以便解决问题:In the Properties pane of the Azure portal, consider the following conditions to resolve your problem:
    • 如果角色实例最近停止过(可查看“中止计数”的值),则可能是因为部署正在进行更新。If the role instance has recently stopped (you can check the value of Abort count), the deployment could be updating. 等待,看角色实例是否会自行恢复运行。Wait to see if the role instance resumes functioning on its own.
    • 如果角色实例处于“忙” 状态,请检查应用程序代码,看是否已处理 StatusCheck 事件。If the role instance is Busy, check your application code to see if the StatusCheck event is handled. 可能需要添加或修复处理此事件的某些代码。You might need to add or fix some code that handles this event.
    • 浏览博客文章 Azure PaaS 计算诊断数据中的诊断数据和故障排除方案。Go through the diagnostic data and troubleshooting scenarios in the blog post Azure PaaS Compute Diagnostics Data.

警告

如果回收云服务,请重置部署的属性,以便有效清除有关原始问题的信息。If you recycle your cloud service, you reset the properties for the deployment, effectively erasing the information for the original problem.

后续步骤Next steps

查看更多针对云服务的故障排除文章View more troubleshooting articles for cloud services.

若要了解如何使用 Azure PaaS 计算机诊断数据对云服务角色问题进行故障排除,请参阅 Kevin Williamson 博客系列To learn how to troubleshoot cloud service role issues by using Azure PaaS computer diagnostics data, see Kevin Williamson's blog series.