{"record":{"id":"d182ce5a65c39aaf","repo":"quarkusio/quarkus","slug":"azure-function-deployment-need-to-use-a-legacy-jar","errorCode":null,"errorMessage":"Azure Function deployment need to use a legacy JAR, please set 'quarkus.package.jar.type=legacy-jar' inside your application.properties","messagePattern":"Azure Function deployment need to use a legacy JAR, please set 'quarkus\\.package\\.jar\\.type=legacy-jar' inside your application\\.properties","errorType":"error_code","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsProcessor.java","lineNumber":92,"sourceCode":"    @BuildStep\n    AzureFunctionsAppNameBuildItem appName(OutputTargetBuildItem output, AzureFunctionsConfig functionsConfig) {\n        String appName = functionsConfig.appName().orElse(output.getBaseName());\n        return new AzureFunctionsAppNameBuildItem(appName);\n    }\n\n    @BuildStep(onlyIf = IsProduction.class, onlyIfNot = NativeBuild.class)\n    public ArtifactResultBuildItem packageFunctions(List<AzureFunctionBuildItem> functions,\n            OutputTargetBuildItem target,\n            AzureFunctionsConfig functionsConfig,\n            PackageConfig packageConfig,\n            AzureFunctionsAppNameBuildItem appName,\n            JarBuildItem jar) throws Exception {\n        if (functions == null || functions.isEmpty()) {\n            log.warn(\"No azure functions exist in deployment\");\n            return null;\n        }\n        if (packageConfig.jar().type() != PackageConfig.JarConfig.JarType.LEGACY_JAR) {\n            throw new BuildException(\"Azure Function deployment need to use a legacy JAR, \" +\n                    \"please set 'quarkus.package.jar.type=legacy-jar' inside your application.properties\",\n                    List.of());\n        }\n        AnnotationHandler handler = new AnnotationHandlerImpl();\n        HashSet<Method> methods = new HashSet<>();\n        for (AzureFunctionBuildItem item : functions)\n            methods.add(item.getMethod());\n        final Map<String, FunctionConfiguration> configMap = handler.generateConfigurations(methods);\n        final String scriptFilePath = String.format(\"../%s.jar\", target.getBaseName() + packageConfig.computedRunnerSuffix());\n        configMap.values().forEach(config -> config.setScriptFile(scriptFilePath));\n        configMap.values().forEach(FunctionConfiguration::validate);\n\n        final ObjectWriter objectWriter = getObjectWriter();\n\n        Path rootPath = target.getOutputDirectory().resolve(\"..\");\n        Path outputDirectory = target.getOutputDirectory();\n        Path functionStagingDir = outputDirectory.resolve(AZURE_FUNCTIONS).resolve(appName.getAppName());\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsProcessor.java#L74-L110","documentation":"Raised by AzureFunctionsProcessor.packageFunctions during the packaging build step when the Azure Functions package type is not the legacy (fast-jar predecessor) JAR format. The Azure Functions host loads the application through a legacy JAR layout; other package types (e.g., the default fast-jar) cannot be consumed by the Functions runtime, so the build step aborts with instructions to switch the package type.","triggerScenarios":"Thrown at extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsProcessor.java:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set quarkus.package.jar.type=legacy-jar in application.properties","Rebuild and redeploy the function after changing the packaging configuration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}