private string GetStorageAccountName(string storageAccountId)
{
Utility.ValidateResourceGroupAndResourceName(ResourceGroupName, Name);
if (string.IsNullOrEmpty(storageAccountId))
{
throw new ArgumentException(Resources.StorageAccountIdException);
}
else
{
string[] resourceParts = storageAccountId.Split('/');
// Valid ARM uri when split on '/' should have 9 parts. Ex: /subscriptions/<sub-id>/resourceGroups/<resource group name>/providers/Microsoft.ClassicStorage/storageAccounts/<account name>
if (resourceParts.Length != 9)
{
throw new ArgumentException(Resources.StorageAccountIdException);
}
return resourceParts[8];
}
}
}