External table

Vineet S 910 Reputation points
2024-08-06T20:24:36.4733333+00:00

Hi, How to read data data from storage account using external table... How to add exact blob storage in location... Any step to get path or copy it

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,714 questions
0 comments No comments
{count} votes

Accepted answer
  1. hossein jalilian 7,280 Reputation points
    2024-08-06T22:45:40.1066667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    To read data from Azure Blob Storage using an external table, you can follow these steps:

    Create an external table in your destination database that points to the data in Blob Storage. Here's a general structure for creating an external table

    CREATE EXTERNAL TABLE [ExternalTableName] 
    (
        [Column1] [datatype],
        [Column2] [datatype],
        ...
    )
    WITH 
    (
        LOCATION = 'https://<storage-account-name>.blob.core.windows.net/<container>/<path-to-files>',
        DATA_SOURCE = [ExternalDataSourceName],
        FILE_FORMAT = [ExternalFileFormatName]
    )
    

    Create a new pipeline and add a Copy activity, and for the source, choose Azure SQL Database or Azure Synapse Analytics depending on where you created the external table

    In the source dataset, you can now write a query that selects from your external table:

    SELECT * FROM [ExternalTableName]
    

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.