The imidazoles and triazoles inhibit fungal ergosterol synthesis by inhibiting the P450 dependent 14α-demethylase. Since ergosterol is an essential compound of the membrane, its absence causes holes in the membrane. As a consequence the fungal cell content (ions, small molecules like amino acids etc.) leaks from the fungal cell.
Because of their inhibition of a P450 enzyme system, the azoles have interactions with many drugs that depend on metabolism in the liver. Drug interactions are responsible for many of the side effects, however, azoles themselves cause gastrointestinal distress.
Azoles interfere with cytochrome P450 enzymes in the sterol synthesis pathway.
Extra info: Azoles can also interfere with drugs metabolized through the P450 enzymes.
Triazoles are newer drugs and have a wider range of antifungal activity than imidazoles.
Extra info: Triazoles are much more specific for the lanosterol enzymes than the older azoles.