In Arizona if the second mortgage was used as "purchase money" in most cases the lender cannot pursue a judgement after the foreclosure. Please note that I used the word "most". The only way to know for sure is to review your specific situation.
A short sale might be an option for you. However we won't know for sure until we talk.
HOWEVER, if your 2nd was taken out after you purchased your home, i.e., as part of an equity line of credit or other equity refi where you got money and used it for other purposes, that type of loan most likely is NOT considered purchase or original money and most likely the lender WILL be able to pursue you for the remaining balance if you were to walk away from the property.
Depending upon your circumstances, a short sale may be a good option for you to settle your 2nd and get out from under both loans. Short sales are complex and involve legal and tax considerations. If this is something you'd like to consider, give us a call at 480-302-9650. We are top 1% short sale agents at the #1 brokerage in the valley. We will take good care of you.