The open radio access network (O-RAN) architecture is consolidating the concept of softwaredefined cellular networks beyond 5G networks, mainly through the introduction of the near-real-time radio access network (RAN) intelligent controller (Near-RT RIC) and the xApps. The deployment of the Near-RT RICs and the assignment of RAN nodes to the deployed RICs play a crucial role in optimizing the performance of O-RANs. In this paper, we develop a robust optimization framework for joint RIC deployment and assignment, considering the uncertainty in user locations. Specifically, our contributions are as follows. First, we develop C 3 P 2 , a robust static joint RIC placement and RAN node-RIC assignment scheme. The objective of C 3 P 2 is to minimize the number of RICs needed to control all RAN nodes while ensuring that the response time to each RAN node will not exceed δ milliseconds with a probability greater than β. Second, we develop CPPA, a robust joint RIC placement and adaptive RAN node-RIC assignment scheme. In contrast to C 3 P 2 , CPPA enjoys a recourse capability, where the RAN node-RIC assignment adapts to the variations in the user locations. We use chance-constrained stochastic optimization combined with several linearization techniques to develop a mixed-integer linear (MIL) formulation for C 3 P 2 . Two-stage stochastic optimization with recourse, combined with several linearization techniques, is used to develop an MIL formulation for CPPA. The optimal performance of C 3 P 2 and CPPA has been examined under various system parameter values. Furthermore, sample average approximation has been employed to design efficient approximate algorithms for solving C 3 P 2 and CPPA. Our results demonstrate the robustness of the proposed stochastic resource allocation schemes for O-RANs compared to existing deterministic allocation schemes. They also show the merits of adapting the allocation of resources to the network uncertainties compared to statically allocating them.INDEX TERMS Open radio access networks (O-RANs), RAN intelligent controller (RIC) placement, RIC assignment, chance-constrained stochastic optimization, two-stage stochastic optimization with recourse, sample average approximation.