def application_enabled(cmd, namespace):
    """Validates account has auto-storage enabled"""
    from azure.mgmt.batch import BatchManagementClient
    from azure.cli.core.commands.client_factory import get_mgmt_service_client
    client = get_mgmt_service_client(cmd.cli_ctx, BatchManagementClient)
    acc = client.batch_account.get(namespace.resource_group_name, namespace
        .account_name)
    if not acc:
        raise ValueError("Batch account '{}' not found.".format(namespace.
            account_name))
    if not acc.auto_storage or not acc.auto_storage.storage_account_id:
        raise ValueError("Batch account '{}' needs auto-storage enabled.".
            format(namespace.account_name))
