{"record":{"id":"e53def865c63fd2d","repo":"quarkusio/quarkus","slug":"you-must-specify-a-subscription-id-to-use-for-depl","errorCode":null,"errorMessage":"You must specify a subscription id to use for deployment as you have more than one","messagePattern":"You must specify a subscription id to use for deployment as you have more than one","errorType":"error_code","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java","lineNumber":323,"sourceCode":"            log.info(AzureString.format(\"Auth environment: %s\", AzureEnvironmentUtils.azureEnvironmentToString(env)));\n        }\n    }\n\n    protected String getTargetSubscriptionId(String defaultSubscriptionId,\n            List<Subscription> subscriptions,\n            List<Subscription> selectedSubscriptions) throws BuildException {\n        if (!StringUtils.isBlank(defaultSubscriptionId)) {\n            return defaultSubscriptionId;\n        }\n\n        if (selectedSubscriptions.size() == 1) {\n            return selectedSubscriptions.get(0).getId();\n        }\n\n        if (selectedSubscriptions.isEmpty()) {\n            throw new BuildException(\"You account does not have a subscription to deploy to\");\n        }\n        throw new BuildException(\"You must specify a subscription id to use for deployment as you have more than one\");\n    }\n\n    protected void printCurrentSubscription(AzureAppService appServiceClient) {\n        if (appServiceClient == null) {\n            return;\n        }\n        final List<Subscription> subscriptions = Azure.az(IAzureAccount.class).account().getSelectedSubscriptions();\n        final Subscription subscription = subscriptions.get(0);\n        if (subscription != null) {\n            log.info(format(SUBSCRIPTION_TEMPLATE, TextUtils.cyan(subscription.getName()),\n                    TextUtils.cyan(subscription.getId())));\n        }\n    }\n\n    protected FunctionAppBase<?, ?, ?> createOrUpdateResource(final FunctionAppConfig config) throws Exception {\n        FunctionApp app = Azure.az(AzureFunctions.class).functionApps(config.subscriptionId()).updateOrCreate(config.appName(),\n                config.resourceGroup());\n        final boolean newFunctionApp = !app.exists();","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java#L305-L341","documentation":"Raised by AzureFunctionsDeployCommand.getTargetSubscriptionId when no default subscription id is configured and the account has more than one selected subscription, so the deployment target is ambiguous. The helper auto-selects when exactly one subscription is available; with several it refuses to pick one arbitrarily and requires an explicit choice.","triggerScenarios":"Thrown at extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java:323 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Specify the subscription id explicitly via the azure-functions plugin configuration (subscriptionId parameter)","Reduce the selected subscriptions in the Azure account to a single one"],"exampleFix":null,"handlingStrategy":"fallback","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-12T22:17:10.623Z"}