0
votes

I tried to export an azure Sql database to an azure blob storage via the Azuer portal and got an error:

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.

In the blob storage account's firewall settings all networks access is denied. It's only possible to connect for selected networks and I activated the option "Allow trusted Microsoft services to access this storage account". The Sql Server and the storage have an private endpoint connection to the same network.

I setup an vm in the same network which was able to access the blob storage.

Is it possible to export a sql database to the azure storage when the public network access is denied? If yes, which setting am I missing?

2
COuld you please tell me how you do that?Jim Xu
Select in the Azure Portal any SQL database and in the menu at the top you'll see an export buttonMartinAy
Hi @MartinAy, is the answer helpful for you?Leon Yue
Hi sorry for the late response. Yes it was helpful. Thank you, I missed the fact that it is not supported. We are using the azure cli docs.microsoft.com/en-us/cli/azure/sql/… in an environment where I don't have an static public ip. Our workaround is to export the sql database to an public blob storage and copy it to a private one afterwards.MartinAy

2 Answers

0
votes

According to my research, when exporting a SQL database to the azure storage, the Azure Storage account behind a firewall is currently not supported. For more details, please refer to here. Besides, you can vote up the feedback to make Microsoft improve the features.

enter image description here

0
votes

Is it possible to export a sql database to the azure storage when the public network access is denied?

Yes, it's impossible. But it will limit the access according the IP address.

If we only set the Storage firewall settings: Allow access from Selected network and Allow trusted Microsoft services to access this storage account, we will get the 403 error when access the storage from Azure SQL database. enter image description here

The thing you missed is that when we set Allow access from Selected network, the Storage firewall will be more like Azure SQL database firewall settings! We can see there is an client IP in Firewall setting. We must add the client IP to the firewall then Azure SQL database could access it.

enter image description here