changing to azure storage connection string #11

Merged
noahspannbauer merged 1 commits from feature/10-switch-to-azure-storage-connection-string into main 2024-10-11 19:45:55 -04:00
2 changed files with 3 additions and 5 deletions
Showing only changes of commit 2248b1e6d7 - Show all commits

View File

@@ -1,4 +1,3 @@
export interface TableOptions {
accountName: string;
accountKey: string;
connectionString;
}

View File

@@ -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<TableClient> {
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;
}