将Azure SQL数据库导出到Azure Blob存储失败

问题描述

我试图通过Azuer门户将azure sql数据库导出到azure blob存储,但出现错误

Error encountered during the service operation. ; 
Exception Microsoft.sqlServer.Management.Dac.Services.ServiceException:Unexpected exception encountered while retrieving Metadata for blob https://<blobstoragename>.blob.core.windows.net/databases/<databaseName>_12.10.2020-11:13:24.bacpac;.; Inner exception Microsoft.WindowsAzure.Storage.StorageException:The Remote Server returned an error: (403) Forbidden.;
Inner exception System.Net.WebException:The Remote Server returned an error: (403) Forbidden.

在Blob存储帐户的防火墙设置中,所有网络访问均被拒绝。只能连接选定的网络,并且我激活了“允许受信任的Microsoft服务访问此存储帐户”选项。 sql Server和存储具有到同一网络的专用端点连接。

我在能够访问Blob存储的同一网络中设置了一个虚拟机。

当拒绝公共网络访问时,是否可以将sql数据库导出到azure存储器?如果是,我缺少哪个设置?

解决方法

根据我的研究,当将SQL数据库导出到Azure存储时,当前不支持防火墙后面的Azure存储帐户。有关更多详细信息,请参阅here。此外,您可以投票给feedback,以使Microsoft改善功能。

enter image description here

,

当拒绝公共网络访问时,是否可以将sql数据库导出到azure存储?

是的,这是不可能的。但这会限制IP地址的访问权限。

如果仅设置存储防火墙设置:Allow access from Selected networkAllow trusted Microsoft services to access this storage account,则从Azure SQL数据库访问存储时将收到403错误。 enter image description here

您错过的事情是,当我们设置Allow access from Selected network时,存储防火墙将更像Azure SQL数据库防火墙设置!我们可以看到Firewall设置中有一个客户端IP。我们必须将客户端IP添加到防火墙,然后Azure SQL数据库才能访问它。

enter image description here