Unable to run an SQL query in Azure Synapse

shailaja Azure 0 Reputation points
2024-06-30T14:25:48.4233333+00:00

Hi,

I am unbale to run a simple sql query. It keeps throwing this following error. File 'https://storagecontainer/Financial Sample.xlsx' cannot be opened because it does not exist or it is used by another process.

I assigned myself with Storage Blob Data Owner role but didn't work. Please reply me with any alternative solutions for the above issue.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,614 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 84,051 Reputation points Microsoft Employee
    2024-07-01T05:46:47.4933333+00:00

    @shailaja Azure - Thanks for the question and using MS Q&A platform.

    To resolve this issue, you need to have proper rights to access the file. Easiest way is to grant yourself Storage Blob Data Contributor role on the storage account you're trying to query.

    If your query fails with the error File cannot be opened because it does not exist or it is used by another process and you're sure that both files exist and aren't used by another process, serverless SQL pool can't access the file. This problem usually happens because your Microsoft Entra identity doesn't have rights to access the file or because a firewall is blocking access to the file.

    By default, serverless SQL pool tries to access the file by using your Microsoft Entra identity. To resolve this issue, you must have proper rights to access the file. The easiest way is to grant yourself a Storage Blob Data Contributor role on the storage account you're trying to query.

    For more information, see:

    For more details, see Query fails because file cannot be opened.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments