Skip to content

Commit f334909

Browse files
authored
More arguments for UsingMsi method. (#10052)
1 parent 5a9e29e commit f334909

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/NuGetGallery.Core/Services/CloudBlobClientWrapper.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ public CloudBlobClientWrapper(string storageConnectionString, bool readAccessGeo
2828
_requestTimeout = requestTimeout; // OK to be null
2929
}
3030

31-
private CloudBlobClientWrapper(string storageConnectionString, TokenCredential tokenCredential)
32-
: this(storageConnectionString)
31+
private CloudBlobClientWrapper(
32+
string storageConnectionString,
33+
TokenCredential tokenCredential,
34+
bool readAccessGeoRedundant = false,
35+
TimeSpan? requestTimeout = null)
36+
: this(storageConnectionString, readAccessGeoRedundant, requestTimeout)
3337
{
3438
_tokenCredential = tokenCredential ?? throw new ArgumentNullException(nameof(tokenCredential));
3539
}
@@ -43,10 +47,14 @@ private CloudBlobClientWrapper(string storageConnectionString)
4347
_blobClient = new Lazy<BlobServiceClient>(CreateBlobServiceClient);
4448
}
4549

46-
public static CloudBlobClientWrapper UsingMsi(string storageConnectionString, string clientId = null)
50+
public static CloudBlobClientWrapper UsingMsi(
51+
string storageConnectionString,
52+
string clientId = null,
53+
bool readAccessGeoRedundant = false,
54+
TimeSpan? requestTimeout = null)
4755
{
4856
var tokenCredential = new ManagedIdentityCredential(clientId);
49-
return new CloudBlobClientWrapper(storageConnectionString, tokenCredential);
57+
return new CloudBlobClientWrapper(storageConnectionString, tokenCredential, readAccessGeoRedundant, requestTimeout);
5058
}
5159

5260
public ISimpleCloudBlob GetBlobFromUri(Uri uri)

0 commit comments

Comments
 (0)