quarkusio/quarkus · error · BuildException

You must specify a subscription id to use for deployment as

Error message

You must specify a subscription id to use for deployment as you have more than one

What it means

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.

Source

Thrown at extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java:323

            log.info(AzureString.format("Auth environment: %s", AzureEnvironmentUtils.azureEnvironmentToString(env)));
        }
    }

    protected String getTargetSubscriptionId(String defaultSubscriptionId,
            List<Subscription> subscriptions,
            List<Subscription> selectedSubscriptions) throws BuildException {
        if (!StringUtils.isBlank(defaultSubscriptionId)) {
            return defaultSubscriptionId;
        }

        if (selectedSubscriptions.size() == 1) {
            return selectedSubscriptions.get(0).getId();
        }

        if (selectedSubscriptions.isEmpty()) {
            throw new BuildException("You account does not have a subscription to deploy to");
        }
        throw new BuildException("You must specify a subscription id to use for deployment as you have more than one");
    }

    protected void printCurrentSubscription(AzureAppService appServiceClient) {
        if (appServiceClient == null) {
            return;
        }
        final List<Subscription> subscriptions = Azure.az(IAzureAccount.class).account().getSelectedSubscriptions();
        final Subscription subscription = subscriptions.get(0);
        if (subscription != null) {
            log.info(format(SUBSCRIPTION_TEMPLATE, TextUtils.cyan(subscription.getName()),
                    TextUtils.cyan(subscription.getId())));
        }
    }

    protected FunctionAppBase<?, ?, ?> createOrUpdateResource(final FunctionAppConfig config) throws Exception {
        FunctionApp app = Azure.az(AzureFunctions.class).functionApps(config.subscriptionId()).updateOrCreate(config.appName(),
                config.resourceGroup());
        final boolean newFunctionApp = !app.exists();

View on GitHub (pinned to e1c734241f)

Solutions

  1. Specify the subscription id explicitly via the azure-functions plugin configuration (subscriptionId parameter)
  2. Reduce the selected subscriptions in the Azure account to a single one
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java:323 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/e53def865c63fd2d. Report an issue: GitHub.