简体   繁体   English

为什么我的 Azure 应用服务备份无法连接到我的 Azure SQL 数据库?

[英]Why can't my Azure app service backup connect to my Azure SQL database?

I am experiencing a problem configuring the backup of an SQL database using Azure.我在使用 Azure 配置 SQL 数据库的备份时遇到问题。

I have web application and an associated Azure SQL database.我有 web 应用程序和关联的 Azure SQL 数据库。 The app connects to the DB no problem.该应用程序连接到数据库没有问题。 I have pasted the connection string provided to me by the Azure UI (Home -> SQL Databases -> My SQL Database) into the connection strings section of the configuration for the App Service (Home -> App Services -> My App Service -> Configuration).我已将 Azure UI 提供给我的连接字符串(主页 -> SQL 数据库 -> 我的 SQL 数据库的连接字符串 -> 应用程序服务配置部分的应用程序服务 -> 应用程序服务部分)粘贴到连接字符串中配置)。 I created a backup of the App Service (Home -> App Services -> My App Service -> Backups -> Configuration) and ticked my connection string to be back up my database.我创建了应用服务的备份(主页 -> 应用服务 -> 我的应用服务 -> 备份 -> 配置)并勾选了我的连接字符串以备份我的数据库。

After about 20 minutes, the backup fails with the error:大约 20 分钟后,备份失败并出现以下错误:

A network-related or instance-specific error occurred while establishing a connection to SQL Server.与 SQL 服务器建立连接时发生与网络相关或特定于实例的错误。 The server was not found or was not accessible.服务器未找到或无法访问。 Verify that the instance name is correct and that SQL Server is configured to allow remote connections.验证实例名称是否正确,并且 SQL 服务器配置为允许远程连接。 (provider: TCP Provider, error: 0 - No such host is known.) (提供者:TCP 提供者,错误:0 - 不知道这样的主机。)

I can connect to the database from the SQL Server Management Studio running on my laptop, and from code running on my laptop, using the server, username and password from the connection string, why can the backup not connect to the database?我可以从笔记本电脑上运行的 SQL Server Management Studio 和笔记本电脑上运行的代码连接到数据库,使用连接字符串中的服务器、用户名和密码,为什么备份无法连接到数据库?

Many thanks for any advice.非常感谢您的任何建议。

Linking the same question asked on MSDN: Azure SQL Database Backup Fails, cannot connect to the database .链接在 MSDN 上提出的相同问题: Azure SQL Database Backup Fails, cannot connect to the database

Please see the Requirements and Restrictions details where this functionality is not supported, which I have listed below the applicable items that apply to your scenario:请参阅不支持此功能的要求和限制详细信息,我在下面列出了适用于您的方案的适用项目:

  • The Backup and Restore feature requires the App Service plan to be in the Standard tier or Premium tier.备份和还原功能要求应用服务计划位于标准层或高级层。 For more information about scaling your App Service plan to use a higher tier, see Scale up an app in Azure.有关扩展应用服务计划以使用更高层的详细信息,请参阅在 Azure 中扩展应用。 Premium tier allows a greater number of daily back ups than Standard tier.高级层允许比标准层更多的每日备份。
  • You need an Azure storage account and container in the same subscription as the app that you want to back up.您需要一个 Azure 存储帐户和容器,与您要备份的应用程序位于同一订阅中。 For more information on Azure storage accounts, see Azure storage account overview .有关 Azure 存储帐户的详细信息,请参阅Azure 存储帐户概述
  • Backups can be up to 10 GB of app and database content.备份最多可达 10 GB 的应用程序和数据库内容。 If the backup size exceeds this limit, you get an error.如果备份大小超过此限制,您会收到错误消息。
  • Using a firewall enabled storage account as the destination for your backups is not supported.不支持使用启用防火墙的存储帐户作为备份目标。 If a backup is configured, you will get failed backups.如果配置了备份,您将获得失败的备份。

If none of the above apply to you, then the issue is an IP Address issue in that you need to enable "Allow access to Azure services" in the firewall for your Azure SQL (logical) Server. If none of the above apply to you, then the issue is an IP Address issue in that you need to enable "Allow access to Azure services" in the firewall for your Azure SQL (logical) Server. Additional troubleshooting can be performed by leveraging Application Insights to capture the backup failure event and then drill into the collected log detail to see what the specific error is.通过利用Application Insights捕获备份失败事件,然后深入收集的日志详细信息以查看具体错误是什么,可以执行其他故障排除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM