@@ -299,12 +299,16 @@ func getClient(cloudConfig cloud.Configuration, opts *configOpts) (*container.Cl
299
299
opts .containerName ,
300
300
)
301
301
var client * container.Client
302
+ clientOpts := azcore.ClientOptions {
303
+ Cloud : cloudConfig ,
304
+ }
305
+
302
306
if len (opts .accountKey ) > 0 {
303
307
cred , err := container .NewSharedKeyCredential (opts .storageAccountName , opts .accountKey )
304
308
if err != nil {
305
309
return nil , err
306
310
}
307
- client , err = container .NewClientWithSharedKeyCredential (containerURL , cred , nil )
311
+ client , err = container .NewClientWithSharedKeyCredential (containerURL , cred , & container. ClientOptions { ClientOptions : clientOpts } )
308
312
if err != nil {
309
313
return nil , err
310
314
}
@@ -318,7 +322,7 @@ func getClient(cloudConfig cloud.Configuration, opts *configOpts) (*container.Cl
318
322
if err != nil {
319
323
return nil , err
320
324
}
321
- client , err = container .NewClient (containerURL , cred , nil )
325
+ client , err = container .NewClient (containerURL , cred , & container. ClientOptions { ClientOptions : clientOpts } )
322
326
if err != nil {
323
327
return nil , err
324
328
}
@@ -335,16 +339,21 @@ func getClient(cloudConfig cloud.Configuration, opts *configOpts) (*container.Cl
335
339
if err != nil {
336
340
return nil , err
337
341
}
338
- client , err = container .NewClient (containerURL , cred , nil )
342
+ client , err = container .NewClient (containerURL , cred , & container. ClientOptions { ClientOptions : clientOpts } )
339
343
if err != nil {
340
344
return nil , err
341
345
}
342
346
} else {
343
- cred , err := azidentity .NewDefaultAzureCredential (nil )
347
+ options := azidentity.DefaultAzureCredentialOptions {
348
+ ClientOptions : azcore.ClientOptions {
349
+ Cloud : cloudConfig ,
350
+ },
351
+ }
352
+ cred , err := azidentity .NewDefaultAzureCredential (& options )
344
353
if err != nil {
345
354
return nil , err
346
355
}
347
- client , err = container .NewClient (containerURL , cred , nil )
356
+ client , err = container .NewClient (containerURL , cred , & container. ClientOptions { ClientOptions : clientOpts } )
348
357
if err != nil {
349
358
return nil , err
350
359
}
0 commit comments