{"record":{"id":"b3d114dfcb263a5f","repo":"testcontainers/testcontainers-java","slug":"the-image-s-requires-an-azurite-container-please-provide-one","errorCode":null,"errorMessage":"The image %s requires an Azurite container. Please provide one with the withAzuriteContainer method!","messagePattern":"The image (.+?) requires an Azurite container\\. Please provide one with the withAzuriteContainer method!","errorType":"exception","errorClass":"java.lang.IllegalStateException","httpStatus":null,"severity":"error","filePath":"modules/azure/src/main/java/org/testcontainers/azure/EventHubsEmulatorContainer.java","lineNumber":85,"sourceCode":"    public EventHubsEmulatorContainer withConfig(final Transferable config) {\n        withCopyToContainer(config, \"/Eventhubs_Emulator/ConfigFiles/Config.json\");\n        return this;\n    }\n\n    /**\n     * Accepts the EULA of the container.\n     *\n     * @return this\n     */\n    public EventHubsEmulatorContainer acceptLicense() {\n        withEnv(\"ACCEPT_EULA\", \"Y\");\n        return this;\n    }\n\n    @Override\n    protected void configure() {\n        if (azuriteContainer == null) {\n            throw new IllegalStateException(\n                \"The image \" +\n                getDockerImageName() +\n                \" requires an Azurite container. Please provide one with the withAzuriteContainer method!\"\n            );\n        }\n        final String azuriteHost = azuriteContainer.getNetworkAliases().get(0);\n        withEnv(\"BLOB_SERVER\", azuriteHost);\n        withEnv(\"METADATA_SERVER\", azuriteHost);\n        // If license was not accepted programmatically, check if it was accepted via resource file\n        if (!getEnvMap().containsKey(\"ACCEPT_EULA\")) {\n            LicenseAcceptance.assertLicenseAccepted(this.getDockerImageName());\n            acceptLicense();\n        }\n    }\n\n    /**\n     * Returns the connection string.\n     *","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/azure/src/main/java/org/testcontainers/azure/EventHubsEmulatorContainer.java#L67-L103","documentation":"The Azure Event Hubs emulator image depends on a companion Azurite storage container (for blob checkpoints). EventHubsEmulatorContainer.configure() validates this at container startup and throws IllegalStateException if withAzuriteContainer was never called, because the emulator cannot boot without it.","triggerScenarios":"Creating a new EventHubsEmulatorContainer(dockerImageName) and calling start() (directly or via @Container) without first invoking withAzuriteContainer(azuriteContainer) with an AzuriteContainer on the same network.","commonSituations":"Upgrading testcontainers-azure from versions before the Azurite requirement was enforced; copying example code that only started the Event Hubs container; forgetting the shared Network between Event Hubs emulator and Azurite.","solutions":["Create an AzuriteContainer, put both containers on the same Network, and call withAzuriteContainer(azurite) before start()","Start the Azurite container (or include it in the same @Testcontainers lifecycle) before the Event Hubs emulator starts","Confirm you use matching versions of AzuriteContainer and the emulator image as per the module docs"],"exampleFix":"// before\nEventHubsEmulatorContainer eventHubs = new EventHubsEmulatorContainer(DockerImageName.parse(\"mcr.microsoft.com/azure-messaging/eventhubs-emulator\"));\n// after\nNetwork network = Network.newNetwork();\nAzuriteContainer azurite = new AzuriteContainer(DockerImageName.parse(\"mcr.microsoft.com/azure-storage/azurite\")).withNetwork(network);\nEventHubsEmulatorContainer eventHubs = new EventHubsEmulatorContainer(dockerImageName)\n    .withNetwork(network)\n    .withAzuriteContainer(azurite);","handlingStrategy":"validation","validationCode":"EventHubsEmulatorContainer eh = new EventHubsEmulatorContainer(image);\nif (eh.getNetworkAliases().isEmpty() || !wiredWithAzurite) // check config before start\n    throw new IllegalStateException(\"Call withAzuriteContainer() with a same-network AzuriteContainer before start()\");","typeGuard":null,"tryCatchPattern":"try {\n    eventHubs.start();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"withAzuriteContainer\")) {\n        throw new IllegalStateException(\"Test setup bug: Event Hubs emulator needs Azurite\", e);\n    }\n    throw e;\n}","preventionTips":["Encapsulate emulator+Azurite wiring in a shared test fixture/base class","Put both containers on the same Network and start Azurite first","Follow the current testcontainers-azure docs; older examples may omit Azurite"],"tags":["azure","event-hubs","azurite","missing-dependency","configuration"],"backgroundTag":"missing-required-config","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}