A canonical reference on this is Dieudonne's History of Algebraic Geometry. An abridged version Historical Development of Algebraic Geometry is freely available, see also Easton's slides.
Let me make a general comment first. When we wonder "however did someone first connect these two [modern ideas]?" we tacitly presuppose that they were always separately available, waiting to be connected. But the truth often is that they were developed connected to each other. Riemann was indeed instrumental in creating the modern algebro-geometric framework, but he did not have the idea to study surfaces via rings of functions for the simple reason than in his time the (general) concept of Riemann surfaces, let alone of rings of functions, did not exist. He was studying Abelian integrals, this led him to consider surfaces on which holomorphic and meromorphic functions, such as Abelian integrals, are defined. And by the time Kronecker and Dedekind-Weber developed the suitable algebraic concepts they already had the connection on display in Riemann's work. So nobody had such an idea first.
Here are some details as described by Dieudonne:
"It is quite a paradox that in the work of this prodigious genius , out of which algebraic geometry emerges entirely regenerated, there is almost no mention of algebraic curve, it is from his theory of algebraic functions and their integrals that all of the birational geometry of the nineteenth and the beginning of the twentieth century issues.
[...] Instead of starting (as would all his predecessors and most of his immediate successors) from an algebraic equation $F(s, z) = 0$ and the Riemann
surface of the algebraic function $s$ of $z$ which it defines, his initial object is an $n$-sheeted Riemann surface without boundary and with a finite number of ramification points, given a priori without any reference to an algebraic equation... Thus, the abstract Riemann surface $S$ is, in fact, identical to that of algebraic function $s(z)$ defined by $F(s, z) = 0$, and Riemann attaches to it what will, after Dedekind's time, be called the field of meromorphic (or rational) functions on $S$. [emphasis Dieudonne's]
Riemann's insights were absorbed in two foundational papers from 1882, by Kronecker (Grundzüge einer arithmetischen Theorie der algebraischen Grössen, Crelle's journal, 92, 1–122) and Dedekind-Weber (Journal für die reine und angewandte Mathematik, 92, 181-290):
"The first task to which each school of algebraic geometry addressed itself was therefore the systematization of the birational theory of algebraic plane curves, incorporating most of Riemann's results with proofs in conformity
with the principles of the school... just as Riemann had revealed the close relationship between algebraic varieties and the theory of complex manifolds, Kronecker and Dedekind-Weber brought to light for the first time the deep similarities between algebraic geometry and the burgeoning theory of algebraic numbers... this conception of algebraic geometry is for us the clearest and simplest one, due to our familiarity with abstract algebra."
Kronecker started defining varieties in terms of rings of polynomials vanishing on them, and developed the notions of subvariety and dimension in terms of ideals (which he called Modulsystems).
"The goal of Dedekind and Weber in their fundamental paper was quite different
and much more limited; namely, they gave purely algebraic proofs for all the algebraic results of Riemann. They start from the fact that, for Riemann, a class of isomorphic Riemann surfaces corresponds to a field $K$ of rational functions, which is a finite extension of the field $C(X)$ of rational fractions in one indeterminate over the complex field; what they set out to do, conversely, if a finite extension $K$ of the field $C(X)$ is given abstractly, is to reconstruct a Riemann surface $S$ such that $K$ will be isomorphic to the field of rational functions on $S$.