Skip to content

Commit a070174

Browse files
committed
Responding to review comments
1 parent 01e0fab commit a070174

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/Common/Commands.Common.Storage/Adapters/ARM.Storage.3/ARMStorageService.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,20 @@ public List<string> AuthenticationKeys
6565
get { return _authenticationKeys; }
6666
}
6767

68-
public static string ParseResourceGroupFromId(string idFromServer)
68+
/// <summary>
69+
/// Get the resource group name from a storage account resource Id
70+
/// </summary>
71+
/// <param name="resourceId">The resource Id for the storage account</param>
72+
/// <returns>The resource group containing the storage account</returns>
73+
public static string ParseResourceGroupFromId(string resourceId)
6974
{
70-
if (!string.IsNullOrEmpty(idFromServer))
75+
if (!string.IsNullOrEmpty(resourceId))
7176
{
72-
string[] tokens = idFromServer.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
77+
string[] tokens = resourceId.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
78+
if (tokens == null || tokens.Length < 4)
79+
{
80+
throw new ArgumentOutOfRangeException("resourceId");
81+
}
7382

7483
return tokens[3];
7584
}

src/Common/Commands.Common.Storage/IStorageService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Storage
2020
public interface IStorageService
2121
{
2222
/// <summary>
23-
/// The eblob service endpoint
23+
/// The blob service endpoint
2424
/// </summary>
2525
Uri BlobEndpoint { get; }
2626

0 commit comments

Comments
 (0)