Concept:
The degree of a differential equation is the highest power of the highest order derivative after removing radicals and fractions involving derivatives.
Step 1: Given:
\[
y=x\frac{dy}{dx}+a\sqrt{1+\left(\frac{dy}{dx}\right)^2}
\]
Let:
\[
p=\frac{dy}{dx}
\]
Then equation becomes:
\[
y=xp+a\sqrt{1+p^2}
\]
Step 2: Move \(xp\) to the left side.
\[
y-xp=a\sqrt{1+p^2}
\]
Step 3: Square both sides to remove the radical.
\[
(y-xp)^2=a^2(1+p^2)
\]
Step 4: Now the derivative \(p=\frac{dy}{dx}\) appears with highest power \(2\).
Therefore, the degree of the differential equation is:
\[
2
\]
Hence,
\[
\boxed{2}
\]