{"record":{"id":"4645757e6598aeae","repo":"quarkusio/quarkus","slug":"the-app-name-s-is-not-valid-the-appname-only","errorCode":null,"errorMessage":"The app name '%s' is not valid. The <appName> only allow alphanumeric characters, hyphens and cannot start or end in a hyphen.","messagePattern":"The app name '(.+?)' is not valid\\. The <appName> only allow alphanumeric characters, hyphens and cannot start or end in a hyphen\\.","errorType":"validation","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java","lineNumber":171,"sourceCode":"\n                @Override\n                public AzureString getDescription() {\n                    return AzureString.fromString(\"Quarkus\");\n                }\n            };\n            OperationThreadContext ctx = OperationThreadContext.current();\n            push.invoke(ctx, dummy);\n        } catch (Exception e) {\n        }\n    }\n\n    protected void validateParameters(AzureFunctionsConfig config, String appName) throws BuildException {\n        // app name\n        if (StringUtils.isBlank(appName)) {\n            throw new BuildException(EMPTY_APP_NAME);\n        }\n        if (appName.startsWith(\"-\") || !appName.matches(APP_NAME_PATTERN)) {\n            throw new BuildException(format(INVALID_APP_NAME, appName));\n        }\n        // resource group\n        if (StringUtils.isBlank(config.resourceGroup())) {\n            throw new BuildException(EMPTY_RESOURCE_GROUP);\n        }\n        if (config.resourceGroup().endsWith(\".\") || !config.resourceGroup().matches(RESOURCE_GROUP_PATTERN)) {\n            throw new BuildException(INVALID_RESOURCE_GROUP_NAME);\n        }\n        // asp name & resource group\n        if (StringUtils.isNotEmpty(config.appServicePlanName())\n                && !config.appServicePlanName().matches(APP_SERVICE_PLAN_NAME_PATTERN)) {\n            throw new BuildException(format(INVALID_SERVICE_PLAN_NAME, APP_SERVICE_PLAN_NAME_PATTERN));\n        }\n        if (config.appServicePlanResourceGroup().isPresent()\n                && StringUtils.isNotEmpty(config.appServicePlanResourceGroup().orElse(null))\n                &&\n                (config.appServicePlanResourceGroup().orElse(null).endsWith(\".\")\n                        || !config.appServicePlanResourceGroup().orElse(null).matches(RESOURCE_GROUP_PATTERN))) {","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java#L153-L189","documentation":"Azure function app names must match Azure's naming rules: alphanumeric characters and hyphens only, must not start or end with a hyphen (checked via APP_NAME_PATTERN). validateParameters throws BuildException with INVALID_APP_NAME when the configured name fails this regex or starts with '-'.","triggerScenarios":"quarkus:deploy with an appName containing underscores, spaces, dots, uppercase invalid per pattern, or leading/trailing hyphens (e.g. my_app, -myapp-, my.app).","commonSituations":"Using the Maven artifactId or project name verbatim as appName when it contains underscores or dots; trailing whitespace or hyphen from templated values; copy-paste from Azure portal showing a display name.","solutions":["Rename the appName to lowercase alphanumerics with interior hyphens only (e.g. my-quarkus-func)","Strip leading/trailing hyphens and replace underscores/dots with hyphens","Keep artifactId and appName separate if the artifactId doesn't satisfy the pattern"],"exampleFix":"<!-- before -->\n<appName>my_quarkus_func</appName>\n<!-- after -->\n<appName>my-quarkus-func</appName>","handlingStrategy":"validation","validationCode":"private static final Pattern APP_NAME = Pattern.compile(\"^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$|^[a-zA-Z0-9]$\");\nif (!APP_NAME.matcher(appName).matches() || appName.startsWith(\"-\")) {\n  throw new IllegalArgumentException(\"Invalid Azure function app name: \" + appName);\n}","typeGuard":"static boolean isValidAzureAppName(String name) {\n  return name != null && !name.startsWith(\"-\")\n    && name.matches(\"[a-zA-Z0-9-]+\")\n    && !name.endsWith(\"-\");\n}","tryCatchPattern":null,"preventionTips":["Sanitize artifactId-derived names: replace [_\\\\s.] with '-'","Trim and strip leading/trailing hyphens from configured names","Validate appName in CI before running deploy"],"tags":["azure-functions","validation","naming"],"backgroundTag":"invalid-resource-name","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}