The two are inevitably tied. Adhering rigidly to a principle will often predetermine an outcome, and pursuing an outcome at any cost will affect which principles you are (and are not) adhering to.
Best to consider both when deciding how to act. Oftentimes the optimum, the scenario which achieves a good outcome while reinforcing your integrity, lies somewhere in-between.