quarkusio/quarkus · error · BuildException

You account does not have a subscription to deploy to

Error message

You account does not have a subscription to deploy to

What it means

Raised by AzureFunctionsDeployCommand.getTargetSubscriptionId when no default subscription id was configured and the authenticated Azure account exposes no selected subscription to deploy to. With multiple candidate subscriptions but none selected and no explicit default, there is no way to infer the deployment target, so the command aborts rather than guessing.

Source

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

    private static void promptAzureEnvironment(AzureEnvironment env) {
        if (env != null && env != AzureEnvironment.AZURE) {
            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(),

View on GitHub (pinned to e1c734241f)

Solutions

  1. Set an explicit subscription id in the azure-functions plugin configuration
  2. Run 'az login' and select a subscription so the account has a default to use
  3. Grant the authenticated account access to at least one subscription
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java:321 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/0703289c831ce59a. Report an issue: GitHub.