Why don't we use Ampere's law to find the magnetic field due to a wire of finite length at its perpendicular bisector? I know that finite length doesn't have symmetry and thus it's hard to apply maths here but take the case of magnetic field of a wire of finite length at a distance $r$ from axis of the wire exactly at perpendicular bisector of wire.
The magnetic field is symmetric here, but still, Ampere's circuital law doesn't apply here. Why is it so?
 A: Ampere's law always applies everywhere (in static conditions); it is one of the Maxwell equations. The only thing is that you have to apply it correctly. It only ever tells you about one component of $\bf B$ at a time, so you have to look at the components one by one, and make sure you do the integral correctly. The case of a finite wire is artificial, as Farcher points out, and this makes the integral in this example impossible to perform until you have specified where the rest of the wire goes. This is because the field appearing in Ampere's law is not just the contribution to the field sourced by whatever current passes through the surface under consideration; it is the whole field at the boundary of the surface.
In contrast, the Biot-Savart law deals with the field due to each current element separately, and this is why it is easier to apply to the finite wire.
A: How is the current in the finite length of wire to be generated?  


*

*Using current carrying wires connected to the wire under consideration?
Then these current carrying
connecting wires will also produce a magnetic field which needs to be
included in the line integral $\int \vec B \cdot d \vec s$.

*Using charges stored at each end of the wire?
Then there is a time varying electric field and the $\frac {\partial}{\partial t}\int\vec E\cdot d\vec A$ term has to be included.

A: we take circular amphere loop for infinite wire because field due to the part parallel to that wire is neglected .but when you talking about a finite wire(whose other part of given current carrying circuit) loop we have to consider the field due to other part of the circuit hence by applying the amphere circuital law you will not get the correct value of magnetic field 
