quarkusio/quarkus · error · BuildException

Subscription %s was not found in current account.

Error message

Subscription %s was not found in current account.

What it means

Raised by AzureFunctionsDeployCommand.checkSubscription when the subscription id targeted for deployment does not match any subscription in the account's subscription list. The deploy flow first authenticates with Azure, lists available subscriptions, then verifies the requested/default subscription id; a mismatch means the id is wrong, the subscription belongs to another tenant, or the logged-in account lacks access to it.

Source

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

            com.microsoft.azure.toolkit.lib.Azure.az(AzureAccount.class).account()
                    .setSelectedSubscriptions(Collections.singletonList(targetSubscriptionId));
            appServiceClient = Azure.az(AzureAppService.class);
            printCurrentSubscription(appServiceClient);
            this.subscriptionId = targetSubscriptionId;
        }
        return appServiceClient;
    }

    protected static void checkSubscription(List<Subscription> subscriptions, String targetSubscriptionId)
            throws BuildException {
        if (StringUtils.isEmpty(targetSubscriptionId)) {
            return;
        }
        final Optional<Subscription> optionalSubscription = subscriptions.stream()
                .filter(subscription -> StringUtils.equals(subscription.getId(), targetSubscriptionId))
                .findAny();
        if (!optionalSubscription.isPresent()) {
            throw new BuildException(format(SUBSCRIPTION_NOT_FOUND, targetSubscriptionId));
        }
    }

    protected Account loginAzure(AzureFunctionsConfig.AuthConfig auth) {
        if (Azure.az(AzureAccount.class).isLoggedIn()) {
            return Azure.az(AzureAccount.class).account();
        }
        final AuthConfiguration authConfig = auth.toAuthConfiguration();
        if (authConfig.getType() == AuthType.DEVICE_CODE) {
            authConfig.setDeviceCodeConsumer(info -> {
                final String message = StringUtils.replace(info.getMessage(), info.getUserCode(),
                        TextUtils.cyan(info.getUserCode()));
                System.out.println(message);
            });
        }
        final AzureEnvironment configEnv = AzureEnvironmentUtils.stringToAzureEnvironment(authConfig.getEnvironment());
        promptAzureEnvironment(configEnv);
        Azure.az(AzureCloud.class).set(configEnv);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Run 'az account list' (or az login) and copy the exact subscription id for the target subscription
  2. Explicitly set the subscriptionId in the azure-functions plugin configuration
  3. Log in with the account/tenant that has access to the target subscription
Defensive patterns

Strategy: validation

When it happens

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