Reputation: 2429
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:
Vnet: 10.0.0.0/16
with a Snet of 10.0.2.0/24
Storage account
Microsoft.Synapse/workspaces
COPY INTO
command)Storage Blob Data Contributor
role added for the Synapse Workspace appSynapse Workspace
Dedicated SQL pool
CREATE EXTERNAL DATA SOURCE [DataSource] WITH (TYPE = HADOOP, LOCATION = 'abfss://${var.datalake_container_name}@${var.datalake_hostname}', CREDENTIAL = [ScopedCredential]);
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
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