{"record":{"id":"03ac1e4e3ff502f3","repo":"quarkusio/quarkus","slug":"unable-to-deploy-azure-function-e-getmessage","errorCode":null,"errorMessage":"Unable to deploy Azure function: ${e.getMessage()}","messagePattern":"Unable to deploy Azure function: (.+?)","errorType":"exception","errorClass":"DeploymentException","httpStatus":null,"severity":"error","filePath":"extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java","lineNumber":121,"sourceCode":"            BuildProducer<DeployCommandActionBuildItem> producer) throws Exception {\n        if (!deployConfig.isEnabled(AZURE_FUNCTIONS)) {\n            return;\n        }\n        validateParameters(config, appName.getAppName());\n        setCurrentOperation();\n        AzureMessager.setDefaultMessager(new QuarkusAzureMessager());\n        Azure.az().config().setLogLevel(HttpLogDetailLevel.NONE.name());\n        initAzureAppServiceClient(config);\n\n        try {\n            final FunctionAppBase<?, ?, ?> target = createOrUpdateResource(\n                    config.toFunctionAppConfig(subscriptionId, appName.getAppName()));\n            Path outputDirectory = output.getOutputDirectory();\n            Path functionStagingDir = outputDirectory.resolve(AZURE_FUNCTIONS).resolve(appName.getAppName());\n\n            deployArtifact(functionStagingDir, target);\n        } catch (AzureToolkitRuntimeException e) {\n            throw new DeploymentException(\"Unable to deploy Azure function: \" + e.getMessage().replace(\"\\\\r\\\\n\", \"\\n\"), e);\n        }\n        producer.produce(new DeployCommandActionBuildItem(AZURE_FUNCTIONS, true));\n    }\n\n    private void setCurrentOperation() {\n        // Note:\n        // This gets rid of some these messages.  Not sure why or how to remove the rest of them yet:\n        // default to NULL OperationContext, because operation or its action operation is null:Quarkus\n        try {\n            Method push = OperationThreadContext.class.getDeclaredMethod(\"pushOperation\", Operation.class);\n            push.setAccessible(true);\n            OperationBase dummy = new OperationBase() {\n                @Override\n                public Object getSource() {\n                    return null;\n                }\n\n                @Override","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java#L103-L139","documentation":"The Azure Functions deploy command wraps Azure Toolkit deployment failures (AzureToolkitRuntimeException) into a Quarkus DeploymentException with this message. The original Azure toolkit error (network, auth, quota, resource conflicts) is preserved as the cause and in the message text (with CRLF normalized). It means the actual Azure-side deployment failed, not the local packaging.","triggerScenarios":"quarkus:deploy reaches deployArtifact and the Azure SDK/Toolkit throws AzureToolkitRuntimeException — e.g. invalid credentials, app name already taken, resource group missing, quota exceeded, network failure.","commonSituations":"Expired Azure CLI login or service-principal credentials; function app name globally not available; wrong subscription/resource group; Azure region capacity issues; corporate proxy blocking deployment endpoints.","solutions":["Read the cause chain for the underlying Azure error (auth, 409 conflict, 403, timeout)","Re-authenticate: az login or refresh service-principal credentials in the auth file","Check the function app name availability and subscription/resource group in the Azure portal","Retry after resolving transient network/proxy issues"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-flight: verify azure credentials and app name availability\naz account show\naz functionapp list --resource-group my-rg --query \"[].name\"","typeGuard":null,"tryCatchPattern":"try {\n  deploy();\n} catch (DeploymentException e) {\n  Throwable cause = e.getCause(); // AzureToolkitRuntimeException\n  if (isTransient(cause)) { backoffAndRetry(); } else { failWithCause(cause); }\n}","preventionTips":["Log/persist the full cause chain of DeploymentException","Run az login / refresh SP credentials before CI deploys","Check function-app name availability and regional capacity pre-deploy","Handle 409 (name taken) and 403 (auth) distinctly before retrying"],"tags":["azure-functions","deployment","azure-toolkit"],"backgroundTag":"azure-deployment-failed","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"}