Since $A$ is a diagonal matrix, then the product $\prod_{n = 1}^N A_{n, \pi(n)}$ contains a zero factor and thus equals zero for every permutation $\pi \in S_N$ except for the identity permutation $1 2 3 \cdots N$, although it may equal zero in this case also if the diagonal has zeros. Thus, applying results
we have
\begin{equation}
\begin{split}
\text{det}(A)
& = \sum_{\pi \in S_N} \left( \text{sign}(\pi) \prod_{n = 1}^N A_{n, \pi(n)} \right) \\
& = \text{sign}(1 2 3 \cdots N) \prod_{n = 1}^N A_{n, n} \\
& = \prod_{n = 1}^N A_{n, n}
\end{split}
\end{equation}
$\square$