diff --git a/src/NuGet.Services.Storage/AzureStorage.cs b/src/NuGet.Services.Storage/AzureStorage.cs index 18f87e4e3b..9995178948 100644 --- a/src/NuGet.Services.Storage/AzureStorage.cs +++ b/src/NuGet.Services.Storage/AzureStorage.cs @@ -424,10 +424,7 @@ public static Uri GetPrimaryServiceUri(string storageConnectionString) { var tempClient = new BlobServiceClient(storageConnectionString); // if _storageConnectionString has SAS token, Uri will contain SAS signature, we need to strip it - var uriBuilder = new UriBuilder(tempClient.Uri); - uriBuilder.Query = ""; - uriBuilder.Fragment = ""; - return uriBuilder.Uri; + return new Uri(tempClient.Uri.GetLeftPart(UriPartial.Path)); } } }