diff --git a/sdk/storage/storage-blob/CHANGELOG.md b/sdk/storage/storage-blob/CHANGELOG.md index b89e962ae399..4f2abc2bdc31 100644 --- a/sdk/storage/storage-blob/CHANGELOG.md +++ b/sdk/storage/storage-blob/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- Fixed an issue of: StoragePipelineOptions is not passed into constructors for blob clients correctly when using undefined as credential parameter. + ### Other Changes ## 12.14.0-beta.1 (2023-03-29) diff --git a/sdk/storage/storage-blob/src/Clients.ts b/sdk/storage/storage-blob/src/Clients.ts index 6b256b73bf03..32f92b9a8d9e 100644 --- a/sdk/storage/storage-blob/src/Clients.ts +++ b/sdk/storage/storage-blob/src/Clients.ts @@ -981,6 +981,9 @@ export class BlobClient extends StorageClient { // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) // The second parameter is undefined. Use anonymous credential. url = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions as StoragePipelineOptions; + } pipeline = newPipeline(new AnonymousCredential(), options); } else if ( credentialOrPipelineOrContainerName && @@ -3666,6 +3669,9 @@ export class BlockBlobClient extends BlobClient { // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) // The second parameter is undefined. Use anonymous credential. url = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions as StoragePipelineOptions; + } pipeline = newPipeline(new AnonymousCredential(), options); } else if ( credentialOrPipelineOrContainerName && diff --git a/sdk/storage/storage-file-share/review/storage-file-share.api.md b/sdk/storage/storage-file-share/review/storage-file-share.api.md index e37165f6f4d7..3d9c0cedbb68 100644 --- a/sdk/storage/storage-file-share/review/storage-file-share.api.md +++ b/sdk/storage/storage-file-share/review/storage-file-share.api.md @@ -1490,7 +1490,7 @@ export type ShareAccessTier = "TransactionOptimized" | "Hot" | "Cool"; // // @public export class ShareClient extends StorageClient { - constructor(connectionString: string, name: string, options?: StoragePipelineOptions); + constructor(connectionString: string, name: string, options?: ShareClientOptions); constructor(url: string, credential?: Credential_2 | TokenCredential, options?: ShareClientOptions); constructor(url: string, pipeline: Pipeline, options?: ShareClientConfig); create(options?: ShareCreateOptions): Promise; diff --git a/sdk/storage/storage-file-share/src/Clients.ts b/sdk/storage/storage-file-share/src/Clients.ts index 33b28cb2807c..0f2850629c32 100644 --- a/sdk/storage/storage-file-share/src/Clients.ts +++ b/sdk/storage/storage-file-share/src/Clients.ts @@ -63,7 +63,7 @@ import { FileLastWrittenMode, } from "./generatedModels"; import { Share, Directory, File } from "./generated/src/operations"; -import { newPipeline, StoragePipelineOptions, Pipeline } from "./Pipeline"; +import { newPipeline, Pipeline } from "./Pipeline"; import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, DEFAULT_HIGH_LEVEL_CONCURRENCY, @@ -566,7 +566,7 @@ export class ShareClient extends StorageClient { */ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */ - constructor(connectionString: string, name: string, options?: StoragePipelineOptions); + constructor(connectionString: string, name: string, options?: ShareClientOptions); /** * Creates an instance of ShareClient. *