Dirac Delta Magnetic field Suppose, we are given a magnetic field $\vec{B}$ as:
$$\vec{B} = \phi \delta(x)\delta(y)\hat{e}_z$$
where $\phi$ is some constant and $\delta$ is dirac delta function.
How do we find the corresponding Magnetic vector potential?
 A: One way to do this (though I wouldn't blame you for accusing me of cheating) is to "remember" the identity (in Cylindrical Coordinates):
$$\nabla \times \left(\frac{\hat{\mathbf{\varphi}}}{\rho}\right) = \hat{\mathbf{z}}\,\, 2 \pi \,\delta^2(\rho).\tag{1}\label{1}$$
This is reminiscent of the divergence identity (in Spherical Polar Coordinates): $$\nabla \cdot \left(\frac{\hat{\mathbf{r}}}{r^2}\right) = 4\pi \delta^3(r).\tag{2}\label{2}$$
Using the fact that $\delta^2(\rho) = \delta(x)\delta(y)$, you should be able to see that you can write the first equation in terms of your field $\mathbf{B}$ as:
$$\nabla \times \left(\frac{\phi}{2\pi\rho}\,\hat{\mathbf{\varphi}}\right) = \mathbf{B}.$$
By using the definition of the vector potential $\nabla \times \mathbf{A} = \mathbf{B},$ you should be able to see that one solution for $\mathbf{A}$ is clearly $$\mathbf{A}(\rho,\varphi,z) = \frac{\phi}{2\pi\rho}\,\hat{\mathbf{\varphi}}.$$
All other solutions for $\mathbf{A}$ can be obtained by adding the gradient of any scalar field (call it $f$), so the general solution is $$\mathbf{A}'= \mathbf{A} + \nabla f.$$ Since the curl of the gradient is zero, $$\nabla \times \mathbf{A}' = \nabla \times \mathbf{A} = \mathbf{B}.$$ This is just a reflection of gauge-invariance.
A: You have the definition of the vector potential.
$$\mathbf{B}=\nabla \times \mathbf{A}$$
According to Stokes' theorem this is equivalent to
$$\iint_S \mathbf{B}\ d\mathbf{S} = \oint_{\partial S} \mathbf{A}\ d\mathbf{r}$$
where $S$ is any surface area and $\partial S$ is its boundary line.
Now choose for $S$ a circle around the $z$-axis.
Then the integral on the left is trivial, it is just the constant $\phi$.
And the integral on the right, done in cylindrical
coordinates ($\rho,\varphi,z$), is a round-trip over $\varphi$:
$$\phi=\int_0^{2\pi} \mathbf{A}\ \hat{\varphi}\ \rho\ d\varphi$$
It is easy to see that a solution is
$$\mathbf{A}(\rho,\varphi,z) = \frac{\phi}{2\pi\rho}\,\hat{\mathbf{\varphi}}$$
