Skip to content

Commit 4a789ef

Browse files
authored
Fix validation for container app names (#222)
1 parent 8cc6f08 commit 4a789ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/commands/createContainerApp/ContainerAppNameStep.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export class ContainerAppNameStep extends AzureWizardPromptStep<IContainerAppCon
3131
name = name ? name.trim() : '';
3232
// to prevent showing an error when the character types the first letter
3333

34-
const { minLength, maxLength } = { minLength: 2, maxLength: 20 };
35-
if (!/^[a-z]([-a-z0-9]*[a-z0-9])?$/.test(name)) {
34+
const { minLength, maxLength } = { minLength: 1, maxLength: 32 };
35+
if (!/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(name)) {
3636
return localize('invalidChar', `A name must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character and cannot have '--'.`);
3737
} else if ((name.length < minLength) || name.length > maxLength) {
3838
return localize('invalidLength', 'The name must be between {0} and {1} characters.', minLength, maxLength);

0 commit comments

Comments
 (0)