Yes , you have to exit the country to get your work visa. I was in qatar and after I got a job there I had to exit qatar so that my company could proceed with my visa process.