As shown in this answer, $n$ can be written as the sum of two squares if and only if, in the prime factorization of $n$, each prime that is $\equiv3\pmod4$ appears with even exponent.
If $x^z+y^2=3z^2$, then $3$ appears with odd exponent. Thus, there are no rational solutions of
$$
\left(\frac xz\right)^2+\left(\frac yz\right)^2=3\tag{1}
$$
As noted, $17=4^2+1^2$. Suppose that
$$
\left(\frac xz\right)^2+\left(\frac yz\right)^2=17\tag{2}
$$
then
$$
\begin{align}
1
&=\frac{x^2+y^2}{17z^2}\\
&=\frac{x+iy}{z(4+i)}\frac{x-iy}{z(4-i)}\tag{3}
\end{align}
$$
which means that
$$
\begin{align}
\frac{x+iy}{z(4+i)}\tag{4}
&=u+iv
\end{align}
$$
where $u,v\in\mathbb{Q}$ so that $u^2+v^2=1$.
Thus,
$$
\frac xz+i\,\frac yz=(4+i)\left(\frac ac+i\,\frac bc\right)\tag{5}
$$
where $a^2+b^2=c^2$ is a Pythagorean triple, all of which can be generated using the formula derived in this answer:
$$
\begin{align}
a &= m^2 - n^2\\
b &= 2mn\\
c &= m^2 + n^2
\end{align}\tag{6}
$$
Using $(5)$ and $(6)$, we can compute all rational solutions of $(2)$.
Example
Using the Pythagorean triple $(3,4,5)$, we get
$$
\left(\frac35+i\,\frac45\right)(4+i)=\frac85+i\,\frac{19}5
$$
and
$$
\left(\frac35-i\,\frac45\right)(4+i)=\frac{16}5-i\,\frac{13}5
$$
Thus, we get
$$
\left(\frac85\right)^2+\left(\frac{19}5\right)^2=17
$$
and
$$
\left(\frac{13}5\right)^2+\left(\frac{16}5\right)^2=17
$$