Skip to content

Commit

Permalink
Use Azure Storage Account NameValidator to check LeaseContainerName (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
David Revoledo authored and serkantkaraca committed Oct 10, 2018
1 parent 96ac802 commit 0419ac2
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ internal AzureStorageCheckpointLeaseManager(CloudStorageAccount cloudStorageAcco
throw new ArgumentNullException(nameof(cloudStorageAccount));
}

// Validate lease container name.
if (!Regex.IsMatch(leaseContainerName, @"^[a-z0-9](([a-z0-9\-[^\-])){1,61}[a-z0-9]$"))
try
{
NameValidator.ValidateContainerName(leaseContainerName);
}
catch (ArgumentException)
{
throw new ArgumentException(
"Azure Storage lease container name is invalid. Please check naming conventions at https://msdn.microsoft.com/en-us/library/azure/dd135715.aspx",
nameof(leaseContainerName));
nameof(leaseContainerName));
}

this.cloudStorageAccount = cloudStorageAccount;
Expand Down

0 comments on commit 0419ac2

Please sign in to comment.