Great question!! The answer, however, is not so simple. It depends on a number of factors, including the type of mortgage loan you'll be using, your income before and after the move, credit history, etc., etc. Basically, if you attempt to buy before you move, the lender will consider your purchase to be a second home or investment property, and the terms of the loan will not be as favorable. And if you already have a loan on your home in CA, then you'll have to qualify for the new loan INCLUDING the old loan in your ratios. There are other factors to consider, so I would recommend two things to you:
1. You would be well advised to first secure the services of a Buyer's Broker Realtor in the area of Arizona in which you intend to buy, to advise and assist you throughout the entire process. The cost to you is typically nothing, zero, zip ~ but the value to you could be immeasurable.
2. Then you should obtain a referral/recommendation from your Arizona Realtor to a local, reputable mortgage lender who can help you obtain loan pre-approval and otherwise consult with you about your options
Let me know if you have other questions, or if we can assist you further.