Rings of $S$-integers are finitely generated as rings Let $K$ be a global field (number field or algebraic function field over a finite field), $\mathcal{V}$ the set of $\mathbb{Z}$-valuations on $K$, $S \subseteq \mathcal{V}$ a finite set. The ring of $S$-integers is the subring of $K$ defined as
$$
\mathcal{O}_S = \lbrace x \in K \mid \forall v \in \mathcal{V} \setminus S : v(x) \geq 0 \rbrace.
$$
I am looking to puzzle together references for the following statement:

Let $R$ be a subring of $K$ such that $K$ is the fraction field or $R$. Then $R$ is finitely generated as a ring if and only if it is contained in some ring of $S$-integers.

A reference for the full statement would be amazing. I have been able to piece together pieces from different references, but the part which is generally missing is that $\mathcal{O}_S$ is actually finitely generated as a ring (equivalently, a $\mathbb{Z}$-algebra) for any choice of $S$.
Where should I look to find a reference for this statement? It feels like a statement from commutative algebra, but a minimal amount of number theory (respectively algebraic geometry) is needed to prove it, at least in the proofs I know of. On the other hand, there is no mention of the statement in any algebraic number theory books I consulted.
Alternatively, if someone has a very short proof, that is also very welcome. I need the statement for an article, but writing out all the details of the number theoretic proof would fall outside of the scope of the article.
 A: $\newcommand{\order}{\mathcal{O}} \newcommand{\Z}{\mathbb{Z}} $Here is a short proof, assuming that the class group is torsion (a result for which you should easily find a reference).
First, $\order = \order_\emptyset$ is finitely generated as a $\Z$-module, hence also as a $\Z$-algebra; let $a_1,\dots,a_k$ be generators.
In the function field case, pick $v_0\in S$; then $\order_\emptyset = \order_{v_0}$.
For every valuation $v\in S$, with $v\neq v_0$ in the function field case, let $x_v\in K$ be such that $v(x_v)<0$ and $w(x_v)=0$ for all $w\neq v$ ($w\neq v,v_0$ in the function field case). Such an element exists: in the number field case since the class group is torsion, and in the function field case by Riemann-Roch.
Claim: $X = \{a_1,\dots,a_k\}\cup \{x_v : v\in S\}$ generates $\order_S$.
Proof: Let $0\neq x\in \order_S$. By definition of $\order_S$, $x$ can only have negative valuation for $v\in S$, so there exists a product $y$ of the $x_v$'s such that $x/y$ has nonnegative valuation everywhere (except possibly at $v_0$), hence belongs to $\order$. So $x/y$ is a polynomial in the $a_i$ and therefore $x$ is a polynomial in the elements of $X$.
