{"record":{"id":"1c4a1febae0d3ca0","repo":"home-assistant/core","slug":"account-not-found","errorCode":null,"errorMessage":"account_not_found","messagePattern":"account_not_found","errorType":"exception","errorClass":"ConfigEntryError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/azure_storage/__init__.py","lineNumber":62,"sourceCode":"        \"\"\"Create a ContainerClient.\"\"\"\n\n        return ContainerClient(\n            account_url=f\"https://{entry.data[CONF_ACCOUNT_NAME]}.blob.core.windows.net/\",\n            container_name=entry.data[CONF_CONTAINER_NAME],\n            credential=entry.data[CONF_STORAGE_ACCOUNT_KEY],\n            transport=AioHttpTransport(session=session),\n        )\n\n    # has a blocking call to open in cpython\n    container_client: ContainerClient = await hass.async_add_executor_job(\n        create_container_client\n    )\n\n    try:\n        if not await container_client.exists():\n            await container_client.create_container()\n    except ResourceNotFoundError as err:\n        raise ConfigEntryError(\n            translation_domain=DOMAIN,\n            translation_key=\"account_not_found\",\n            translation_placeholders={CONF_ACCOUNT_NAME: entry.data[CONF_ACCOUNT_NAME]},\n        ) from err\n    except ClientAuthenticationError as err:\n        raise ConfigEntryAuthFailed(\n            translation_domain=DOMAIN,\n            translation_key=\"invalid_auth\",\n            translation_placeholders={CONF_ACCOUNT_NAME: entry.data[CONF_ACCOUNT_NAME]},\n        ) from err\n    except AzureError as err:\n        raise ConfigEntryNotReady(\n            translation_domain=DOMAIN,\n            translation_key=\"cannot_connect\",\n            translation_placeholders={CONF_ACCOUNT_NAME: entry.data[CONF_ACCOUNT_NAME]},\n        ) from err\n\n    entry.runtime_data = container_client","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/azure_storage/__init__.py#L44-L80","documentation":"Raised as ConfigEntryError (translation key account_not_found) when the Azure Blob Storage container_client.exists()/create_container() call fails with ResourceNotFoundError during setup. It signals that the storage account named in the config entry does not exist (HTTP 404 at the account level, not just a missing container). This is a fatal setup error; HA will not retry automatically.","triggerScenarios":"setup_entry builds a ContainerClient for the account; exists() returns HTTP 404 because the account name is mistyped or the account was deleted, so ResourceNotFoundError maps to ConfigEntryError.","commonSituations":"Typo in the account name during config flow, storage account deleted or renamed, using the wrong Azure subscription/tenant credentials that resolve to a different environment.","solutions":["Confirm the storage account name in the Azure portal and fix it in the integration's reconfigure flow","Check that the account exists in the subscription the credentials (SAS token or entra auth) can see","If the account was intentionally recreated, update the config entry with the new account name and key/SAS","Distinguish from a missing container: a missing container is auto-created (create_container) only when the account itself resolves"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from azure.storage.blob import ContainerClient\ncs = f\"DefaultEndpointsProtocol=https;AccountName={name};AccountKey={key};EndpointSuffix=core.windows.net\"\nclient = ContainerClient.from_connection_string(cs, container_name)\nif not await client.exists():\n    # account reachable; container will be auto-created\n    pass","typeGuard":"def is_account_not_found(err: BaseException) -> bool:\n    from azure.core.exceptions import ResourceNotFoundError\n    return isinstance(err, ResourceNotFoundError)","tryCatchPattern":"try:\n    if not await container_client.exists():\n        await container_client.create_container()\nexcept ResourceNotFoundError as err:\n    raise ConfigEntryError(translation_domain=DOMAIN, translation_key=\"account_not_found\", ...) from err","preventionTips":["Pre-check account existence in the config flow with a lightweight list_containers call","Use copy-paste for account names rather than typing them","Treat 404 on the account as config, not connectivity — fix the entry, don't retry"],"tags":["azure","blob-storage","config-entry","not-found"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}