It seems a little rude to me, but then it is out of context.
The most common way to ask someone their profession is:
What do you do?
or the slightly longer
What do you do for a living?
Asking "what are you?" seems rude because in isolation it is not clear that you are asking about a person's profession. It could be misinterpreted as bringing into question someone's worth or validity.
But there could be contexts in which "what are you" would be just fine if certain other things have already been established in the conversation.
Person 1: My colleague in the police force has just been promoted to Chief Inspector.
Person 2: What are you?
Person 1: I'm a Chief Superintendent.
This doesn't seem as rude because it has already been established that the two people are talking about roles or job titles and the question is now drawing a comparison between two different roles.