The adillah (evidences) that fiqh is derived from are four:-
The Book and the Sunnah, and these two are the foundation by which the mukallafoon (the legally responsible) are addressed [with commands and prohibitions], and upon which is built their religion. Then ijmaa' (consensus) and al-qiyaasus-saheeh (sound and correct analogy), these two rest upon and are supported by the Book and the Sunnah. So fiqh - in its entirety (from its beginning to its end) - does not leave the realms of these four usool (fundamentals).
These four (types of) evidences are comprised in the majority of the important ahkaam (rulings). They are indicated to by the nusoos (texts) from a) the Book and b) the Sunnah; and c) the Scholars have ijmaa' (consensus) about them, and d) they are indicated to by qiyaasus-saheeh (sound and correct analogy); [all] because of what they entail of benefit, if it is a command; or what they contain of harm, if it is a forbiddance. Very few of the ahkaam have been differed over by the Scholars. In such cases the closest of them to the truth is the one who correctly [most soundly] refers back to these four usool.