dh762
dh762

Reputation: 2429

403 Forbidden when accessing Storage Account through firewall from Azure Synapse's dedicated SQL pool

Getting a 403 Forbidden when trying to access a firewall'd Storage Account from a dedicated SQL pool in Azure Synapse.

It works when I disable the Storage Account firewall.

Relevant configuration:

Error in the StorageBlobLogs:

OperationName=GetBlob
StatusCode=403 
StatusText=AuthorizationFailure 
CallerIpAddress=10.0.0.11:34573 
AuthenticationType=AccountKey

Error in the client app:

'copy into "myschema"."mytable" from 'https://mystorageaccount.blob.core.windows.net/mycontainer/abcde/' with (credential = (identity = 'Storage Account Key', secret = 'xxx'), file_type = 'csv', fieldterminator = ',', rowterminator = '0x0a', firstrow = 2, encoding = 'utf8');

Not able to validate external location because The remote server returned an error: (403) Forbidden.

Any pointers would be appreciated.

Upvotes: 0

Views: 1647

Answers (1)

dh762
dh762

Reputation: 2429

The problem was that the COPY INTO command does not support Storage Account Access key.

This works:

copy into "myschema"."mytable" 
from 'https://mystorageaccount.blob.core.windows.net/mycontainer' 
with (credential = (identity = 'Managed Identity'), file_type = 'csv', fieldterminator = ',', rowterminator = '0x0a', firstrow = 2, encoding = 'utf8');

This is supported in this Microsoft docs page:

When accessing storage that is protected with the firewall, you can use User Identity or Managed Identity.

However this docs page mentioned only Serverless SQL pools, not (also) dedicated SQL pools.

Upvotes: 0

Related Questions