With the query results stored in a DataFrame, we can use petl to extract, transform, and load the Azure Table data. Sql = "SELECT Name, Price FROM NorthwindProducts WHERE ShipCity = 'New York'"Įxtract, Transform, and Load the Azure Table Data In this article, we read data from the NorthwindProducts entity. Use SQL to create a statement for querying Azure Table. Use the connect function for the CData Azure Table Connector to create a connection for working with Azure Table data.Ĭnxn = mod.connect("AccessKey=myAccessKey Account=myAccountName ")Ĭreate a SQL Statement to Query Azure Table You can now connect with a connection string. ![]() Code snippets follow, but the full source code is available at the end of the article.įirst, be sure to import the modules (including the CData Connector) with the following: Once the required modules and frameworks are installed, we are ready to build our ETL app. Pip install pandas Build an ETL App for Azure Table Data in Python Use the pip utility to install the required modules and frameworks: pip install petl ![]() You can obtain the access key by selecting your account and clicking Access Keys in the Settings section.Īfter installing the CData Azure Table Connector, follow the procedure below to install the other required modules and start accessing Azure Table through Python objects. To obtain these values, navigate to the Storage Accounts blade in the Azure portal. Either the Primary or Secondary Access Keys can be used. Set the Account property to the Storage Account Name and set AccessKey to one of the Access Keys. Specify your AccessKey and your Account to connect. For this article, you will pass the connection string as a parameter to the create_engine function. ![]() Create a connection string using the required connection properties. When you issue complex SQL queries from Azure Table, the driver pushes supported SQL operations, like filters and aggregations, directly to Azure Table and utilizes the embedded SQL engine to process unsupported operations client-side (often SQL functions and JOIN operations).Ĭonnecting to Azure Table data looks just like connecting to any relational data source. With built-in, optimized data processing, the CData Python Connector offers unmatched performance for interacting with live Azure Table data in Python. This article shows how to connect to Azure Table with the CData Python Connector and use petl and pandas to extract, transform, and load Azure Table data. With the CData Python Connector for Azure Table and the petl framework, you can build Azure Table-connected applications and pipelines for extracting, transforming, and loading Azure Table data. The rich ecosystem of Python modules lets you get to work quickly and integrate your systems more effectively.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |