File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
Blueprint.Test/ScenarioTests Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1212// limitations under the License.
1313// ----------------------------------------------------------------------------------
1414
15+ using Microsoft . Azure . Commands . Blueprint . Common ;
1516using Microsoft . WindowsAzure . Commands . ScenarioTest ;
17+ using System ;
1618using Xunit ;
1719
1820namespace Microsoft . Azure . Commands . Blueprint . Test . ScenarioTests
@@ -58,5 +60,15 @@ public void TestRemoveBlueprintAssignment()
5860 TestRunner . RunTestScript ( "Test-RemoveBlueprintAssignment" ) ;
5961 }
6062
63+
64+ [ Fact ]
65+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
66+ public void TestResourceNameValidation ( )
67+ {
68+ Assert . Null ( Record . Exception ( ( ) => Utils . ValidateName ( "Valid-resourceId" ) ) ) ;
69+ Assert . Null ( Record . Exception ( ( ) => Utils . ValidateName ( "60b96b66-0ead-4cfc-831c-801616145b9c" ) ) ) ;
70+ Assert . Null ( Record . Exception ( ( ) => Utils . ValidateName ( "H_-e.l(1)o۳৭﹏dž" ) ) ) ;
71+ Assert . Throws < ArgumentException > ( ( ) => Utils . ValidateName ( "trailing." ) ) ;
72+ }
6173 }
6274}
Original file line number Diff line number Diff line change 1818 - Additional information about change #1
1919-->
2020## Upcoming Release
21+ * Fixed blueprint assignment name validation
2122
2223## Version 0.4.0
2324* Fix custom delegating handler to only apply to Blueprint requests
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public static string GetScopeForSubscription(string subscriptionId)
5757
5858 public static void ValidateName ( string name )
5959 {
60- var regex = @"^[0-9a-zA-Z_-]* $" ;
60+ var regex = @"^[-\w\._\(\)]+(?<!\.) $" ;
6161
6262 Match match = Regex . Match ( name , regex , RegexOptions . CultureInvariant ) ;
6363
You can’t perform that action at this time.
0 commit comments