{"record":{"id":"935a023049969b03","repo":"quarkusio/quarkus","slug":"subscription-s-was-not-found-in-current-account","errorCode":null,"errorMessage":"Subscription %s was not found in current account.","messagePattern":"Subscription (.+?) was not found in current account\\.","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":256,"sourceCode":"            com.microsoft.azure.toolkit.lib.Azure.az(AzureAccount.class).account()\n                    .setSelectedSubscriptions(Collections.singletonList(targetSubscriptionId));\n            appServiceClient = Azure.az(AzureAppService.class);\n            printCurrentSubscription(appServiceClient);\n            this.subscriptionId = targetSubscriptionId;\n        }\n        return appServiceClient;\n    }\n\n    protected static void checkSubscription(List<Subscription> subscriptions, String targetSubscriptionId)\n            throws BuildException {\n        if (StringUtils.isEmpty(targetSubscriptionId)) {\n            return;\n        }\n        final Optional<Subscription> optionalSubscription = subscriptions.stream()\n                .filter(subscription -> StringUtils.equals(subscription.getId(), targetSubscriptionId))\n                .findAny();\n        if (!optionalSubscription.isPresent()) {\n            throw new BuildException(format(SUBSCRIPTION_NOT_FOUND, targetSubscriptionId));\n        }\n    }\n\n    protected Account loginAzure(AzureFunctionsConfig.AuthConfig auth) {\n        if (Azure.az(AzureAccount.class).isLoggedIn()) {\n            return Azure.az(AzureAccount.class).account();\n        }\n        final AuthConfiguration authConfig = auth.toAuthConfiguration();\n        if (authConfig.getType() == AuthType.DEVICE_CODE) {\n            authConfig.setDeviceCodeConsumer(info -> {\n                final String message = StringUtils.replace(info.getMessage(), info.getUserCode(),\n                        TextUtils.cyan(info.getUserCode()));\n                System.out.println(message);\n            });\n        }\n        final AzureEnvironment configEnv = AzureEnvironmentUtils.stringToAzureEnvironment(authConfig.getEnvironment());\n        promptAzureEnvironment(configEnv);\n        Azure.az(AzureCloud.class).set(configEnv);","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java#L238-L274","documentation":"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.","triggerScenarios":"Thrown at extensions/azure-functions/deployment/src/main/java/io/quarkus/azure/functions/deployment/AzureFunctionsDeployCommand.java:256 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run 'az account list' (or az login) and copy the exact subscription id for the target subscription","Explicitly set the subscriptionId in the azure-functions plugin configuration","Log in with the account/tenant that has access to the target subscription"],"exampleFix":null,"handlingStrategy":"validation","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"}