Required arrangement is shown in figure. According to Ampere's circuital law.
For an internal point, $ r< R$
$B_{\text {internal }}=\frac{\mu_{0}(0)}{2 \pi r}=0$
For a point on the pipe, $r=R$
$B=\frac{\mu_{0} I}{2 \pi r}$
For an external point, $r < R$
$B_{\text {extemal }}=\frac{\mu_{0} I}{2 \pi r}$