Azure Web 应用配置及管理常见问题解答Configuration and management FAQs for Web Apps in Azure

本文对 Azure App Service Web 应用功能配置和管理常见问题 (FAQ) 进行了解答。This article has answers to frequently asked questions (FAQs) about configuration and management issues for the Web Apps feature of Azure App Service.

如果本文未解决你的 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.

如果需要移动应用服务资源,是否有什么限制需要注意?Are there limitations I should be aware of if I want to move App Service resources?

如果打算将应用服资源转移到新的资源组或订阅,有一些限制需要注意。If you plan to move App Service resources to a new resource group or subscription, there are a few limitations to be aware of. 有关详细信息,请参阅应用服务限制For more information, see App Service limitations.

如何将自定义域名用于 Web 应用?How do I use a custom domain name for my web app?

有关在 Azure Web 应用中使用自定义域名的常见问题的解答,请参阅如何映射自定义域名的详细演练。For answers to common questions about using a custom domain name with your Azure web app, see a detailed walkthrough of how to map a custom domain name.

如何上传和配置 Web 应用的现有 TLS/SSL 证书?How do I upload and configure an existing TLS/SSL certificate for my web app?

若要了解如何上传和设置现有的自定义 TLS/SSL 证书,请参阅将 TLS/SSL 证书添加到应用服务应用To learn how to upload and set up an existing custom TLS/SSL certificate, see Add a TLS/SSL certificate to your App Service app.

如何在 Azure 中为 Web 应用购买和配置新的 TLS/SSL 证书?How do I purchase and configure a new TLS/SSL certificate in Azure for my web app?

若要了解如何为应用服务 Web 应用购买和设置 TLS/SSL 证书,请参阅将 TLS/SSL 证书添加到应用服务应用To learn how to purchase and set up a TLS/SSL certificate for your App Service web app, see Add a TLS/SSL certificate to your App Service app.

如何移动 Application Insights 资源?How do I move Application Insights resources?

当前,Azure Application Insights 不支持移动操作。Currently, Azure Application Insights doesn't support the move operation. 如果原始资源组包括 Application Insights 资源,则无法移动该资源。If your original resource group includes an Application Insights resource, you cannot move that resource. 如果在尝试移动应用服务应用时包括了 Application Insights 资源,则整个移动操作会失败。If you include the Application Insights resource when you try to move an App Service app, the entire move operation fails. 不过,即使 Application Insights 和应用服务计划不与应用位于同一资源组中,应用也可以正常运行。However, Application Insights and the App Service plan do not need to be in the same resource group as the app for the app to function correctly.

有关详细信息,请参阅应用服务限制For more information, see App Service limitations.

可从何处找到指南清单,了解有关资源移动操作的详细信息?Where can I find a guidance checklist and learn more about resource move operations?

应用服务限制说明如何将资源移到新订阅或同一订阅的新资源组中。App Service limitations shows you how to move resources to either a new subscription or to a new resource group in the same subscription. 可以获取有关资源移动清单的信息,了解哪些服务支持移动操作,并了解有关应用服务限制及其他主题的详细信息。You can get information about the resource move checklist, learn which services support the move operation, and learn more about App Service limitations and other topics.

如何为 Web 应用设置服务器时区?How do I set the server time zone for my web app?

为 Web 应用设置服务器时区:To set the server time zone for your web app:

  1. 在 Azure 门户的应用服务订阅中,转到“应用程序设置”菜单。In the Azure portal, in your App Service subscription, go to the Application settings menu.
  2. 在“应用设置”下,添加此设置:Under App settings, add this setting:
    • 值 = 所需时区Value = The time zone you want
  3. 选择“保存” 。Select Save.

对于在 Windows 上运行的应用服务,请参阅默认时区一文中的“时区”列了解接受的值。For the App services that run on Windows, see the Timezone column in the Default Time Zones article for accepted values.

为什么连续 Web 作业有时会失败?Why do my continuous WebJobs sometimes fail?

默认情况下,如果 Web 应用已处于空闲状态相当一段时间,则其处于未加载的状态。By default, web apps are unloaded if they are idle for a set period of time. 这样可以让系统节省资源。This lets the system conserve resources. 在基本和标准计划中,可打开“Always On”设置,保持 Web 应用一直处于已加载的状态。In Basic and Standard plans, you can turn on the Always On setting to keep the web app loaded all the time. 如果 Web 应用运行连续的 Web 作业,应启用“Always On”;否则,这些 Web 作业可能无法可靠运行。If your web app runs continuous WebJobs, you should turn on Always On, or the WebJobs might not run reliably. 有关详细信息,请参阅创建连续运行的 Web 作业For more information, see Create a continuously running WebJob.

如何获取 Web 应用的出站 IP 地址?How do I get the outbound IP address for my web app?

获取 Web 应用出站 IP 地址列表:To get the list of outbound IP addresses for your web app:

  1. 在 Azure 门户中的 Web 应用边栏选项卡上,转到“属性”菜单。In the Azure portal, on your web app blade, go to the Properties menu.
  2. 搜索出站 IP 地址Search for outbound ip addresses.

随即显示出站 IP 地址列表。The list of outbound IP addresses appears.

如果你的网站在应用服务环境中承载,则若要了解如何获取出站 IP 地址,请参阅出站网络地址To learn how to get the outbound IP address if your website is hosted in an App Service Environment, see Outbound network addresses.

如何获取 Web 应用的保留或专用入站 IP 地址?How do I get a reserved or dedicated inbound IP address for my web app?

若要为针对 Azure 应用网站发出的入站调用设置专用或保留 IP 地址,请安装并配置基于 IP 的 TLS/SSL 证书。To set up a dedicated or reserved IP address for inbound calls made to your Azure app website, install and configure an IP-based TLS/SSL certificate.

请注意,若要将专用或保留的 IP 地址用于入站调用,应用服务计划必须包含在基本或更高的服务计划中。Note that to use a dedicated or reserved IP address for inbound calls, your App Service plan must be in a Basic or higher service plan.

是否可以导出应用服务证书以在 Azure 外部使用(如用于在其他位置承载的网站)?Can I export my App Service certificate to use outside Azure, such as for a website hosted elsewhere?

是的,可以导出这些证书以在 Azure 外部使用。Yes, you can export them to use outside Azure. 有关详细信息,请参阅应用服务证书和自定义域的常见问题解答For more information, see FAQs for App Service certificates and custom domains.

是否可以导出应用服务证书以用于其他 Azure 云服务?Can I export my App Service certificate to use with other Azure cloud services?

门户针对通过 Azure Key Vault 将应用服务证书部署到应用服务应用提供一流的体验。The portal provides a first-class experience for deploying an App Service certificate through Azure Key Vault to App Service apps. 但是,我们从客户处收到了在应用服务平台外部使用这些证书(例如,用于 Azure 虚拟机)的请求。However, we have been receiving requests from customers to use these certificates outside the App Service platform, for example, with Azure Virtual Machines. 若要了解如何创建应用服务证书的本地 PFX 副本以便可以将证书用于其他 Azure 资源,请参阅创建应用服务证书的本地 PFX 副本To learn how to create a local PFX copy of your App Service certificate so you can use the certificate with other Azure resources, see Create a local PFX copy of an App Service certificate.

有关详细信息,请参阅应用服务证书和自定义域的常见问题解答For more information, see FAQs for App Service certificates and custom domains.

尝试备份 Web 应用时,为何出现“部分成功”的消息?Why do I see the message "Partially Succeeded" when I try to back up my web app?

备份失败的一个常见原因是应用程序正在使用某些文件。A common cause of backup failure is that some files are in use by the application. 执行备份时,正在使用的文件会被锁定。Files that are in use are locked while you perform the backup. 这会阻止对这些文件的备份操作,并可能导致“部分成功”状态。This prevents these files from being backed up and might result in a "Partially Succeeded" status. 可以通过将文件从备份过程中排除来防止这种情况发生。You can potentially prevent this from occurring by excluding files from the backup process. 可以选择仅备份所需文件。You can choose to back up only what is needed. 有关详细信息,请参阅 Azure Web 应用仅备份站点的重要部分For more information, see Backup just the important parts of your site with Azure web apps.

如何从 HTTP 响应中删除标头?How do I remove a header from the HTTP response?

若要移删除 HTTP 响应的标头,请更新站点的 web.config 文件。To remove the headers from the HTTP response, update your site's web.config file. 有关详细信息,请参阅在 Azure 网站上删除标准服务器标头For more information, see Remove standard server headers on your Azure websites.

应用服务是否符合 PCI 标准 3.0 和 3.1?Is App Service compliant with PCI Standard 3.0 and 3.1?

目前,Azure App Service 的 Web 应用功能符合 PCI 数据安全标准 (DSS) 3.0 版级别 1。Currently, the Web Apps feature of Azure App Service is in compliance with PCI Data Security Standard (DSS) version 3.0 Level 1. PCI DSS 3.1 版正在设计之中。PCI DSS version 3.1 is on our roadmap. 我们正在计划如何采用最新标准。Planning is already underway for how adoption of the latest standard will proceed.

PCI DSS 3.1 版证书要求禁用传输层安全性 (TLS) 1.0。PCI DSS version 3.1 certification requires disabling Transport Layer Security (TLS) 1.0. 目前,大多数应用服务计划无法禁用 TLS 1.0。Currently, disabling TLS 1.0 is not an option for most App Service plans. 但是,如果使用应用服务环境,或者愿意将工作负荷迁移到应用服务环境,则可以更好地控制环境。However, If you use App Service Environment or are willing to migrate your workload to App Service Environment, you can get greater control of your environment. 这涉及到通过与 Azure 支持部门联系来禁用 TLS 1.0。This involves disabling TLS 1.0 by contacting Azure Support. 在不久的将来,我们计划使用户可以访问这些设置。In the near future, we plan to make these settings accessible to users.

有关详细信息,请参阅 App Service Web 应用 PCI 标准 3.0 和 3.1 符合性For more information, see Azure App Service web app compliance with PCI Standard 3.0 and 3.1.

如何使用过渡环境和部署槽位?How do I use the staging environment and deployment slots?

在标准版和高级版应用服务计划中,将 Web 应用部署到应用服务时,可部署到单独的部署槽位而不是默认的生产槽位。In Standard and Premium App Service plans, when you deploy your web app to App Service, you can deploy to a separate deployment slot instead of to the default production slot. 部署槽是具有自己的主机名的动态 Web 应用。Deployment slots are live web apps that have their own host names. 两个部署槽(包括生产槽)之间的 Web 应用内容与配置元素可以交换。Web app content and configuration elements can be swapped between two deployment slots, including the production slot.

有关使用部署槽位的详细信息,请参阅在应用服务中设置过渡环境For more information about using deployment slots, see Set up a staging environment in App Service.

如何访问和查看 Web 作业日志?How do I access and review WebJob logs?

查看 Web 作业日志:To review WebJob logs:

  1. 登录到 Kudu 网站 (https://*yourwebsitename*。Sign in to your Kudu website (https://*yourwebsitename*
  2. 选择 Web 作业。Select the WebJob.
  3. 选择“切换输出”按钮。Select the Toggle Output button.
  4. 若要下载输出文件,请选择“下载”链接。To download the output file, select the Download link.
  5. 对于单个运行,选择“单个调用”。For individual runs, select Individual Invoke.
  6. 选择“切换输出”按钮。Select the Toggle Output button.
  7. 选择下载链接。Select the download link.

我在尝试对 SQL Server 使用混合连接。I'm trying to use Hybrid Connections with SQL Server. 为什么会看到消息“System.OverflowException: 算术运算导致了溢出”?Why do I see the message "System.OverflowException: Arithmetic operation resulted in an overflow"?

如果使用混合连接访问 SQL Server,则 2016 年 5 月 10 的 Microsoft.NET 更新可能会导致连接失败。If you use Hybrid Connections to access SQL Server, a Microsoft .NET update on May 10, 2016, might cause connections to fail. 你可能会看到此消息:You might see this message:

Exception: System.Data.Entity.Core.EntityException: The underlying provider failed on Open. —> System.OverflowException: Arithmetic operation resulted in an overflow. or (64 bit Web app) System.OverflowException: Array dimensions exceeded supported range, at System.Data.SqlClient.TdsParser.ConsumePreLoginHandshake


该异常是由于混合连接管理器存在问题而导致,该问题现已修复。The exception was caused by an issue with the Hybrid Connection Manager that has since been fixed. 请务必更新混合连接管理器以解决此问题。Be sure to update your Hybrid Connection Manager to resolve this issue.

如何添加 URL 重写规则?How do I add a URL rewrite rule?

若要添加 URL 重写规则,请使用 wwwroot 文件夹中的相关配置条目创建一个 web.config 文件。To add a URL rewrite rule, create a web.config file with the relevant config entries in the wwwroot folder. 有关详细信息,请参阅 Azure 应用服务:了解 URL 重写For more information, see Azure App Services: Understanding URL rewrite.

如何控制应用服务的入站流量?How do I control inbound traffic to App Service?

在站点层面上,有两种方法可用于控制应用服务的入站流量:At the site level, you have two options for controlling inbound traffic to App Service:

如果使用应用服务环境,则可以使用 Barracuda 防火墙If you use App Service Environment, you can use Barracuda firewall.

如何在应用服务 Web 应用中封锁端口?How do I block ports in an App Service web app?

在应用服务共享租户环境中,由于基础结构的性质,无法封锁特定端口。In the App Service shared tenant environment, it is not possible to block specific ports because of the nature of the infrastructure. TCP 端口 4020、4022 和 4024 也可能打开,用于 Visual Studio 远程调试。TCP ports 4020, 4022, and 4024 also might be open for Visual Studio remote debugging.

在应用服务环境中,可完全控制入站和出站流量。In App Service Environment, you have full control over inbound and outbound traffic. 可以使用网络安全组限制或阻止特定端口。You can use Network Security Groups to restrict or block specific ports. 有关应用服务环境的详细信息,请参阅应用服务环境简介For more information about App Service Environment, see Introducing App Service Environment.

如何捕获 F12 跟踪?How do I capture an F12 trace?

捕获 F12 跟踪有两种方法:You have two options for capturing an F12 trace:

  • F12 HTTP 跟踪F12 HTTP trace
  • F12 控制台输出F12 console output

F12 HTTP 跟踪F12 HTTP trace

  1. 在 Internet Explorer 中,转到网站。In Internet Explorer, go to your website. 请务必先登录,然后再执行后续步骤。It's important to sign in before you do the next steps. 否则,F12 跟踪会捕获敏感登录数据。Otherwise, the F12 trace captures sensitive sign-in data.
  2. 按 F12。Press F12.
  3. 确认已选中“网络”选项卡,然后选中绿色“播放”按钮。Verify that the Network tab is selected, and then select the green Play button.
  4. 执行可重现问题的步骤。Do the steps that reproduce the issue.
  5. 选择红色“停止”按钮。Select the red Stop button.
  6. 选择“保存”按钮(磁盘图标),然后保存 HAR 文件(在 Internet Explorer 和 Microsoft Edge 中),或右键单击 HAR 文件,然后选择“保存为包含内容的 HAR”(在 Chrome 中)。Select the Save button (disk icon), and save the HAR file (in Internet Explorer and Microsoft Edge) or right-click the HAR file, and then select Save as HAR with content (in Chrome).

F12 控制台输出F12 console output

  1. 选择“控制台”选项卡。Select the Console tab.
  2. 对于每个至少包含一项的选项卡,选择选项卡(“错误”、“警告”或“信息”)。For each tab that contains more than zero items, select the tab (Error, Warning, or Information). 如果未选中选项卡,移开光标时,选项卡图标呈灰色或黑色。If the tab isn't selected, the tab icon is gray or black when you move the cursor away from it.
  3. 右键单击窗格中的信息区域,然后选择“全部复制”。Right-click in the message area of the pane, and then select Copy all.
  4. 将复制的文本粘贴到文件中,然后保存该文件。Paste the copied text in a file, and then save the file.

若要查看 HAR 文件,可以使用 HAR 查看器To view an HAR file, you can use the HAR viewer.

在我尝试将应用服务 Web 应用到连接到与 ExpressRoute 连接的虚拟网络时,为何会遇到错误?Why do I get an error when I try to connect an App Service web app to a virtual network that is connected to ExpressRoute?

如果尝试将 Azure Web 应用连接到与 Azure ExpressRoute 连接的虚拟网络,则会失败。If you try to connect an Azure web app to a virtual network that's connected to Azure ExpressRoute, it fails. 此时会显示以下消息:“网关不是 VPN 网关”。The following message appears: "Gateway is not a VPN gateway."

当前,无法与连接到 ExpressRoute 的虚拟网络建立点到站点 VPN 连接。Currently, you cannot have point-to-site VPN connections to a virtual network that is connected to ExpressRoute. 对于同一虚拟网络而言,点到站点 VPN 和 ExpressRoute 不能共存。A point-to-site VPN and ExpressRoute cannot coexist for the same virtual network. 有关详细信息,请参阅 ExpressRoute 和站点到站点 VPN 连接限制和局限性For more information, see ExpressRoute and site-to-site VPN connections limits and limitations.

如何将应用服务 Web 应用连接到具有静态路由(基于策略)网关的虚拟网络?How do I connect an App Service web app to a virtual network that has a static routing (policy-based) gateway?

当前,不支持将应用服务 Web 应用连接到具有静态路由(基于策略)网关的虚拟网络。Currently, connecting an App Service web app to a virtual network that has a static routing (policy-based) gateway is not supported. 如果目标虚拟网络已经存在,必须在连接到应用之前借助动态路由网关使网络处于点到站点 VPN 启用状态。If your target virtual network already exists, it must have point-to-site VPN enabled, with a dynamic routing gateway, before it can be connected to an app. 如果网关设置为静态路由,则无法启用点到站点 VPN。If your gateway is set to static routing, you cannot enable a point-to-site VPN.

有关详细信息,请参阅将应用与 Azure 虚拟网络进行集成For more information, see Integrate an app with an Azure virtual network.

在应用服务环境中,为何即使有两个可用的辅助角色,也只能创建一个应用服务计划?In my App Service Environment, why can I create only one App Service plan, even though I have two workers available?

为了提供容错能力,应用服务环境要求每个辅助角色池至少需要一个额外的计算资源。To provide fault tolerance, App Service Environment requires that each worker pool needs at least one additional compute resource. 无法为额外的计算资源分配工作负荷。The additional compute resource cannot be assigned a workload.

有关详细信息,请参阅如何创建应用服务环境For more information, see How to create an App Service Environment.

在尝试创建应用服务环境时,为何遇到超时?Why do I see timeouts when I try to create an App Service Environment?

优势,创建应用服务环境会失败。Sometimes, creating an App Service Environment fails. 在这种情况下,你会在活动日志中看到以下错误:In that case, you see the following error in the Activity logs:

ResourceID: /subscriptions/{SubscriptionID}/resourceGroups/Default-Networking/providers/Microsoft.Web/hostingEnvironments/{ASEname}
Error:{"error":{"code":"ResourceDeploymentFailure","message":"The resource provision operation did not complete within the allowed timeout period."}}

若要解决此问题,请确保不存在以下任何情况:To resolve this, make sure that none of the following conditions are true:

  • 子网太小。The subnet is too small.
  • 子网非空。The subnet is not empty.
  • ExpressRoute 会阻碍应用服务环境的网络连接要求。ExpressRoute prevents the network connectivity requirements of an App Service Environment.
  • 错误的网络安全组会阻碍应用服务环境的网络连接要求。A bad Network Security Group prevents the network connectivity requirements of an App Service Environment.
  • 强制隧道处于打开状态。Forced tunneling is turned on.

有关详细信息,请参阅部署(创建)新 Azure 应用服务环境时的常见问题For more information, see Frequent issues when deploying (creating) a new Azure App Service Environment.

为什么无法删除应用服务计划?Why can't I delete my App Service plan?

如果应用服务计划与任何应用服务应用相关联,则无法删除此应用服务计划。You can't delete an App Service plan if any App Service apps are associated with the App Service plan. 删除应用服务计划前,请从应用服务计划中删除所有关联的应用服务应用。Before you delete an App Service plan, remove all associated App Service apps from the App Service plan.

如何计划 Web 作业?How do I schedule a WebJob?

可以使用 Cron 表达式创建计划的 Web 作业:You can create a scheduled WebJob by using Cron expressions:

  1. 创建一个 settings.job 文件。Create a settings.job file.
  2. 在此 JSON 文件中,使用 Cron 表达式将计划属性包括在内:In this JSON file, include a schedule property by using a Cron expression:
    { "schedule": "{second}
    {minute} {hour} {day}
    {month} {day of the week}" }

有关计划的 Web 作业的详细信息,请参阅使用 Cron 表达式创建计划的 Web 作业For more information about scheduled WebJobs, see Create a scheduled WebJob by using a Cron expression.

如何对应用服务应用执行渗透测试?How do I perform penetration testing for my App Service app?

若要执行渗透测试,请提交请求To perform penetration testing, submit a request.

如何为使用流量管理器的应用服务 Web 应用配置自定义域名?How do I configure a custom domain name for an App Service web app that uses Traffic Manager?

若要了解如何将自定义域名用于使用 Azure 流量管理器实现负载均衡的应用服务应用,请参阅为使用流量管理器的 Azure Web 应用配置自定义域名To learn how to use a custom domain name with an App Service app that uses Azure Traffic Manager for load balancing, see Configure a custom domain name for an Azure web app with Traffic Manager.

我的应用服务证书被标记为存在欺诈。My App Service certificate is flagged for fraud. 如何解决此问题?How do I resolve this?


本文进行了更新,以便使用新的 Azure PowerShell Az 模块。This article has been updated to use the new Azure PowerShell Az module. 你仍然可以使用 AzureRM 模块,至少在 2020 年 12 月之前,它将继续接收 bug 修补程序。You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. 若要详细了解新的 Az 模块和 AzureRM 兼容性,请参阅新 Azure Powershell Az 模块简介To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. 有关 Az 模块安装说明,请参阅安装 Azure PowerShellFor Az module installation instructions, see Install Azure PowerShell.

在应用服务证书购买的域验证过程中,可能会看到以下消息:During the domain verification of an App Service certificate purchase, you might see the following message:

“你的证书已被标记为可能存在欺诈。"Your certificate has been flagged for possible fraud. 请求当前正在审查中。The request is currently under review. 如果证书未在 24 小时内变为可用,请联系 Azure 支持部门。”If the certificate does not become usable within 24 hours, please contact Azure Support."

如该消息所示,此欺诈验证过程可能需要最多 24 小时才能完成。As the message indicates, this fraud verification process might take up to 24 hours to complete. 在此期间,你会继续看到该消息。During this time, you'll continue to see the message.

如果你的应用服务证书在 24 小时后继续显示此消息,请运行以下 PowerShell 脚本。If your App Service certificate continues to show this message after 24 hours, please run the following PowerShell script. 该脚本会联系证书提供商直接解决问题。The script contacts the certificate provider directly to resolve the issue.

Connect-AzAccount -Environment AzureChinaCloud
Set-AzContext -SubscriptionId <subId>
$actionProperties = @{
    "Name"= "<Customer Email Address>"
Invoke-AzResourceAction -ResourceGroupName "<App Service Certificate Resource Group Name>" -ResourceType Microsoft.CertificateRegistration/certificateOrders -ResourceName "<App Service Certificate Resource Name>" -Action resendRequestEmails -Parameters $actionProperties -ApiVersion 2015-08-01 -Force   

应用服务中是如何进行身份验证和授权的?How do authentication and authorization work in App Service?

有关应用服务中的身份验证和授权的详细文档,请参阅各种标识提供者登录的文档:For detailed documentation for authentication and authorization in App Service, see docs for various identify provider sign-ins:

如何将默认 * 域重定向到 Azure Web 应用的自定义域?How do I redirect the default * domain to my Azure web app's custom domain?

在 Azure 中使用 Web 应用创建新网站时,将向你的站点分配一个默认 域。When you create a new website by using Web Apps in Azure, a default domain is assigned to your site. 如果将自定义主机名添加到站点,并且不希望用户能够访问默认 * 域,可以将默认 URL 进行重定向。If you add a custom host name to your site and don't want users to be able to access your default * domain, you can redirect the default URL. 若要了解如何将源自网站默认域的所有通信流重定向到自定义域,请参阅将默认域重定向到 Azure Web 应用中的自定义域To learn how to redirect all traffic from your website's default domain to your custom domain, see Redirect the default domain to your custom domain in Azure web apps.

如何确定应用服务中安装的 .NET 版本?How do I determine which version of .NET version is installed in App Service?

若要查找应用服务中安装的 Microsoft.NET 版本,最快的方法是使用 Kudu 控制台。The quickest way to find the version of Microsoft .NET that's installed in App Service is by using the Kudu console. 可以从门户或使用应用服务应用的 URL,来访问 Kudu 控制台。You can access the Kudu console from the portal or by using the URL of your App Service app. 有关详细说明,请参阅确定应用服务中安装的 .NET 版本For detailed instructions, see Determine the installed .NET version in App Service.

为什么自动缩放不按预期方式工作?Why isn't Autoscale working as expected?

如果 Azure 自动缩放未按预期方式缩放 web 应用,可能会陷入一种困境,在这种情况下,建议主动选择不进行缩放以避免由“不稳定”引起的无限循环。If Azure Autoscale hasn't scaled in or scaled out the web app instance as you expected, you might be running into a scenario in which we intentionally choose not to scale to avoid an infinite loop due to "flapping." 这种情况通常是因扩展阈值和缩小阈值之间的差值不足所致。This usually happens when there isn't an adequate margin between the scale-out and scale-in thresholds. 若要了解如何避免“波动”以及如何了解其他自动缩放最佳做法,请参阅自动缩放最佳做法To learn how to avoid "flapping" and to read about other Autoscale best practices, see Autoscale best practices.

为什么自动缩放有时仅进行部分缩放?Why does Autoscale sometimes scale only partially?

当指标超过预配置的限值时,将触发自动缩放。Autoscale is triggered when metrics exceed preconfigured boundaries. 有时可能会发现,与预期相比,仅填充了部分容量。Sometimes, you might notice that the capacity is only partially filled compared to what you expected. 当所需的实例数无法实现时,则可能会发生这种情况。This might occur when the number of instances you want are not available. 在这种情况下,自动缩放使用可用的实例数进行部分填充。In that scenario, Autoscale partially fills in with the available number of instances. 然后,自动缩放运行重新平衡逻辑,以获取更多容量。Autoscale then runs the rebalance logic to get more capacity. 它会分配剩余实例。It allocates the remaining instances. 请注意,这可能需要几分钟的时间。Note that this might take a few minutes.

如果在几分钟后未看到预期数量的实例,则可能是因为部分重填已足以使指标处于边界内。If you don't see the expected number of instances after a few minutes, it might be because the partial refill was enough to bring the metrics within the boundaries. 或者,可能自动缩放已执行缩小操作,因为已达到度量值的下限。Or, Autoscale might have scaled down because it reached the lower metrics boundary.

如果以上情况都不存在而问题仍然存在,请提交支持请求。If none of these conditions apply and the problem persists, submit a support request.

如何为内容启用 HTTP 压缩?How do I turn on HTTP compression for my content?

若要同时为静态和动态内容类型启用压缩,请将以下代码添加到应用程序级别的 web.config 文件:To turn on compression both for static and dynamic content types, add the following code to the application-level web.config file:

    <urlCompression doStaticCompression="true" doDynamicCompression="true" />

还可以指定要压缩的特定动态和静态 MIME 类型。You also can specify the specific dynamic and static MIME types that you want to compress. 有关详细信息,请参阅简单 Azure 网站上的 httpCompression 设置,查看我们对一个论坛问题的回复。For more information, see our response to a forum question in httpCompression settings on a simple Azure website.

如何从本地环境迁移到应用服务?How do I migrate from an on-premises environment to App Service?

若要将站点从 Windows Web 服务器迁移到应用服务,可以使用 Azure 应用服务迁移助手。To migrate sites from Windows web servers to App Service, you can use Azure App Service Migration Assistant. 该迁移工具会根据需要在 Azure 中创建 Web 应用和数据库,然后发布内容。The migration tool creates web apps and databases in Azure as needed, and then publishes the content. 有关详细信息,请参阅 Azure App Service 迁移助手For more information, see Azure App Service Migration Assistant.