def configure_application_control(api, configuration, api_version, api_exception, policy_id):
    """ Modifies a policy to set the application control state to on.

    :param api: The Deep Security API modules.
    :param configuration: Configuration object to pass to the api client.
    :param api_version: The version of the API to use.
    :param api_exception: The Deep Security API exception module.
    :param policy_id: The ID of the policy to modify.
    :return: A PoliciesApi object that contains the ID of the modified policy.
    """

    # Get the policy
    policies_api = api.PoliciesApi(api.ApiClient(configuration))

    # Turn on Application Control
    application_control_policy_extension = api.ApplicationControlPolicyExtension()
    application_control_policy_extension.state = "on"

    # Update the policy
    update_policy = api.Policy()
    update_policy.application_control = application_control_policy_extension

    try:
        # Modify the policy on Deep Security Manager
        app_control_policy = policies_api.modify_policy(policy_id, update_policy, api_version, overrides=False)
        return app_control_policy

    except api_exception as e:
        return "Exception: " + str(e)