How to use the @azure/storage-blob.TokenCredential function in @azure/storage-blob

To help you get started, we’ve selected a few @azure/storage-blob 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 / providers / storage / azureBlobStorage.ts View on Github external
private getCredential(): Credential {
        if (this.options.oauthToken) {
            return new TokenCredential(this.options.oauthToken);
        } else {
            return new AnonymousCredential();
        }
    }
github serverless / serverless-azure-functions / src / services / azureBlobStorageService.ts View on Github external
public async initialize() {
    if (this.storageCredential) {
      return;
    }
    this.storageCredential = (this.authType === AzureStorageAuthType.SharedKey)
      ?
      new SharedKeyCredential(this.storageAccountName, await this.getKey())
      :
      new TokenCredential(await this.getToken());
  }