Hi,
Thanks for reaching out to Microsoft Q&A.
The error message "Bad or inaccessible location specified in external data source 'Azure_DbServer'" indicates that there may be a configuration issue with your external data source or the way you're trying to access the Azure SQL Database Serverless from Azure Synapse.
- External Data Source Configuration:
- Ensure that the
LOCATION
specified in yourCREATE EXTERNAL DATA SOURCE
statement is correct. The format should besqlserver://<server-name>.database.windows.net:1433
. double-check the server name and ensure it matches your azure SQL db serverless instance. - Verify that the credentials used in
CREATE DATABASE SCOPED CREDENTIAL [MyCred]
are correct and have the necessary permissions to access the database.
- Ensure that the
- Database and Table Access:
- Confirm that the database and table you are trying to access (
DbName.dbo.PUBLIC_HOLIDAYS
) exist and that the user associated with the credentials has access to them. - Make sure the user has been granted the appropriate roles, such as
db_datareader
, to read from the specified table.
- Confirm that the database and table you are trying to access (
- Network and Firewall Settings:
- Check if there are any network restrictions or firewall rules that might be preventing Azure Synapse from connecting to your Azure SQL Database Serverless. Ensure that Synapse is allowed to access the SQL Database.
- Querying External Tables:
- When querying an external table, ensure that the SQL syntax is correct. The external table should point to a valid data source and file format. Since you've defined a
DeltaFileFormat
, ensure that this format is supported for the data you're trying to access.
- When querying an external table, ensure that the SQL syntax is correct. The external table should point to a valid data source and file format. Since you've defined a
- Using Managed Identity:
- If you are using a managed identity for authentication, ensure that the identity has been correctly configured and granted access to the Azure SQL Database.
https://learn.microsoft.com/en-us/azure/synapse-analytics/sql/create-use-external-tables
Point to note:
- Serverless SQL Pool Limitations:
- Note that serverless SQL pools have certain limitations regarding external tables, especially concerning the data formats they can handle. Ensure that the formats you are using are supported as per the azure doc .
- Testing Connectivity:
- You can test the connectivity to your azureSQLdb serverless using tools like azure data studio or SSMS to ensure that the issue is specific to the Synapse setup.
Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.