A third viewpoint is to consider an analytic function as a solution to the Cauchy-Riemann partial differential equation with a boundary condition. The function to be defined has a boundary, at which it is supposed to acquire a certain set of values. It might be questioned whether such a thing is possible, but deciding whether or not is part of getting the solution.
Of course, it is possible to iterate the Cauchy-Riemann equations to get Laplace equations expressing the harmonicity of the real and imaginary parts of the complex function separately. It then becomes a question of solving Laplace's equation with boundary conditions, which leads to the Dirichlet integral and Riemann's mapping theorem.