A hydraulic drive apparatus comprising: an electric motor; a variable displacement pump driven by the electric motor, the pump including a pair of pump ports (3a, 3b) whose delivery side and suction side are switched with each other in accordance with a rotation direction of the electric motor; a hydraulic actuator connected to the pair of pump ports by a first supply/discharge line and a second supply/discharge line; and a control device that controls the electric motor based on an actuator position command value for the hydraulic actuator; wherein the pump is configured such that a volume of the pump decreases in accordance with increase in a pressure difference between the first supply/discharge line and the second supply/discharge line; characterised in that: the pump includes: a rotary shaft; a cylinder block that rotates together with the rotary shaft, the cylinder block being provided with a plurality of cylinder bores formed therein; a plurality of pistons inserted in the plurality of cylinder bores, respectively; a port plate in which the pair of pump ports is formed; a swash plate that defines a stroke of each of the plurality of pistons; and a spring that presses the swash plate; in that the pump is configured to generate, in accordance with a pressure difference between the pair of pump ports, a moment at which the pistons tilt the swash plate; and in that each of the pair of pump ports (3a, 3b) has such a shape that when each pump port is divided at a center of the rotary shaft into a portion on a spring-present side where the spring is present and a portion on a spring-absent side where the spring is absent, a length of the portion on the spring-absent side is greater than a length of the portion on the spring-present side. an electric motor; a variable displacement pump driven by the electric motor, the pump including a pair of pump ports (3a, 3b) whose delivery side and suction side are switched with each other in accordance with a rotation direction of the electric motor; a hydraulic actuator connected to the pair of pump ports by a first supply/discharge line and a second supply/discharge line; and a control device that controls the electric motor based on an actuator position command value for the hydraulic actuator; wherein the pump is configured such that a volume of the pump decreases in accordance with increase in a pressure difference between the first supply/discharge line and the second supply/discharge line; characterised in that: the pump includes: a rotary shaft; a cylinder block that rotates together with the rotary shaft, the cylinder block being provided with a plurality of cylinder bores formed therein; a plurality of pistons inserted in the plurality of cylinder bores, respectively; a port plate in which the pair of pump ports is formed; a swash plate that defines a stroke of each of the plurality of pistons; and a spring that presses the swash plate; in that the pump is configured to generate, in accordance with a pressure difference between the pair of pump ports, a moment at which the pistons tilt the swash plate; and in that each of the pair of pump ports (3a, 3b) has such a shape that when each pump port is divided at a center of the rotary shaft into a portion on a spring-present side where the spring is present and a portion on a spring-absent side where the spring is absent, a length of the portion on the spring-absent side is greater than a length of the portion on the spring-present side. the pump includes: a rotary shaft; a cylinder block that rotates together with the rotary shaft, the cylinder block being provided with a plurality of cylinder bores formed therein; a plurality of pistons inserted in the plurality of cylinder bores, respectively; a port plate in which the pair of pump ports is formed; a swash plate that defines a stroke of each of the plurality of pistons; and a spring that presses the swash plate; in that a rotary shaft; a cylinder block that rotates together with the rotary shaft, the cylinder block being provided with a plurality of cylinder bores formed therein; a plurality of pistons inserted in the plurality of cylinder bores, respectively; a port plate in which the pair of pump ports is formed; a swash plate that defines a stroke of each of the plurality of pistons; and a spring that presses the swash plate; in that the pump is configured to generate, in accordance with a pressure difference between the pair of pump ports, a moment at which the pistons tilt the swash plate; and in that each of the pair of pump ports (3a, 3b) has such a shape that when each pump port is divided at a center of the rotary shaft into a portion on a spring-present side where the spring is present and a portion on a spring-absent side where the spring is absent, a length of the portion on the spring-absent side is greater than a length of the portion on the spring-present side.