From 67014a3080e1c564f8988df609ef9866b1783e0e Mon Sep 17 00:00:00 2001 From: noahspannbauer Date: Fri, 11 Oct 2024 18:45:55 -0500 Subject: [PATCH] changing to azure storage connection string (#11) --- libs/modules/src/azTable/az-table.interface.ts | 3 +-- libs/modules/src/azTable/az-table.service.ts | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/modules/src/azTable/az-table.interface.ts b/libs/modules/src/azTable/az-table.interface.ts index 4a80ed2..d30fd89 100644 --- a/libs/modules/src/azTable/az-table.interface.ts +++ b/libs/modules/src/azTable/az-table.interface.ts @@ -1,4 +1,3 @@ export interface TableOptions { - accountName: string; - accountKey: string; + connectionString; } \ No newline at end of file diff --git a/libs/modules/src/azTable/az-table.service.ts b/libs/modules/src/azTable/az-table.service.ts index 242ea95..39bdb5e 100644 --- a/libs/modules/src/azTable/az-table.service.ts +++ b/libs/modules/src/azTable/az-table.service.ts @@ -1,7 +1,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { TableOptions } from './az-table.interface'; import { TABLE_OPTIONS } from './az-table.constants'; -import { TableClient, AzureNamedKeyCredential } from '@azure/data-tables'; +import { TableClient } from '@azure/data-tables'; @Injectable() export class TableService { @@ -11,8 +11,7 @@ export class TableService { ) {} async getTableClient(tableName: string): Promise { - const credential: AzureNamedKeyCredential = new AzureNamedKeyCredential(this.tablesOptions.accountName, this.tablesOptions.accountKey); - const tableClient: TableClient = new TableClient(`https://${this.tablesOptions.accountName}.table.core.windows.net`, tableName, credential); + const tableClient: TableClient = new TableClient(this.tablesOptions.connectionString, tableName); return tableClient; }