CData Python Connector for Azure Table Storage

Build 24.0.9060

Establishing a Connection

The objects available within our connector are accessible from the "cdata.azuretables" module. To use the module's objects directly:

  1. Import the module as follows:
    import cdata.azuretables as mod
  2. To establish a connection string, call the connect() method from the connector object using an appropriate connection string, such as:
    mod.connect("AccessKey=myAccessKey;Account=myAccountName;")

Connecting to Azure Table Storage APIs

The driver will connect to the Azure Table Storage account specified by Account. By default, connections to the Azure Table Storage are secured via SSL, though this can be controlled through UseSSL. The authentication method to the Azure Table Storage is determined by the AuthScheme property.

Authenticating to Azure Table Storage

The following mechanisms may be used to authenticate.

Access Key

Set Account to the storage account name and set the AccessKey of the storage account to connect. Follow the steps below to obtain these values:

If using Storage as the Backend (default):

  1. Log into the Azure portal and select Storage Accounts in the services menu on the left.
  2. If you currently do not have any storage accounts, create one by clicking the Add button.
  3. Click the link for the storage account you want to use and select Access Keys under Settings. The Access Keys window contains the storage account name and key (you can use either key1 or key2 to connect) that you will need to use in the connector. These properties map to the Account and AccessKey connector connection properties respectively.

If using CosmosDB as the Backend:

  1. Log into the Azure portal and select Cosmos DB in the services menu on the left.
  2. Click the link for the Cosmos DB account you want to use and select Connection String under Settings. The Connection String window contains the Cosmos DB account name and primary key that you will need to use in the connector. These properties map to the Account and AccessKey connector connection properties respectively.

Shared Access Signature

Set Account to the storage account name and set the SharedAccessSignature to a valid signature of a resource to connect to. The SharedAccessSignature may be generated with a tool such as Azure Storage Explorer.

Typically when SharedAccessSignature is used, the specific table to work with must also be specified via the Tables connection property. If no table is specified, a table listing will be attemped, but may fail due to a lack of permissions.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060