How to use the @azure/arm-storage.StorageAccounts function in @azure/arm-storage

To help you get started, we’ve selected a few @azure/arm-storage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / VoTT / src / services / authenticationService.ts View on Github external
public async getStorageAccountKey(subscriptionId: string, resourceGroupName: string, accountName: string, credentials: ServiceClientCredentials) {
        const context = new StorageManagementClientContext(this.credentials, subscriptionId);
        const storageAccounts = new StorageAccounts(context);
        const accounts = await storageAccounts.list();
        if (!accounts.find((account) => account.name === accountName)) {
            throw new Error(`Couldn't find storage account with name ${accountName}`);
        }
        const { keys } = await storageAccounts.listKeys(resourceGroupName, accountName);
        return keys[0].value;
    }
}
github serverless / serverless-azure-functions / src / services / azureBlobStorageService.ts View on Github external
private async getKey(): Promise {
    const context = new StorageManagementClientContext(this.credentials, this.subscriptionId)
    const storageAccounts = new StorageAccounts(context);
    const keys = await storageAccounts.listKeys(this.resourceGroup, this.storageAccountName);
    return keys.keys[0].value;
  }

@azure/arm-storage

A generated SDK for StorageManagementClient.

MIT
Latest version published 6 months ago

Package Health Score

88 / 100
Full package analysis