MCPcopy Create free account
hub / github.com/Azure/Azurite / createAzureDataTablesClient

Function createAzureDataTablesClient

tests/table/utils/table.entity.test.utils.ts:158–186  ·  view source on GitHub ↗
(
  local: boolean,
  tableName: string
)

Source from the content-addressed store, hash-verified

156 * @return {*} {TableClient}
157 */
158export function createAzureDataTablesClient(
159 local: boolean,
160 tableName: string
161): TableClient {
162 if (local) {
163 const sharedKeyCredential = new AzureNamedKeyCredential(
164 EMULATOR_ACCOUNT_NAME,
165 EMULATOR_ACCOUNT_KEY
166 );
167
168 return new TableClient(
169 `https://${HOST}:${PORT}/${EMULATOR_ACCOUNT_NAME}`,
170 tableName,
171 sharedKeyCredential
172 );
173 } else {
174 // return new TableClient(
175 // process.env[AZURE_DATATABLES_STORAGE_STRING]! +
176 // process.env[AZURE_DATATABLES_SAS]!,
177 // tableName
178 // );
179
180 return new TableClient(
181 process.env[AZURE_DATATABLES_STORAGE_STRING]!,
182 tableName,
183 new AzureSASCredential(process.env[AZURE_DATATABLES_SAS]!)
184 );
185 }
186}
187/**
188 * creates an Azure Data Tables client for local or service tests
189 *

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…