Quote (from the RHS):
"Onions need a sunny, sheltered site with fertile, well-drained soil"
Source:
https://www.rhs.org.uk/advice/grow-your-own/vegetables/onions
So your proposed location doesn't seem ideal. It doesn't seem to be that much better for peas either:
"For best results peas need an open, sunny position with good drainage"
https://www.rhs.org.uk/advice/grow-your-own/vegetables/peas
However peas aren't totally ruled out by the RHS, as this is their list of shade-tolerant vegetables:
"Beetroot, carrots (baby), chard, kale, kohl rabi, leaf salads, lettuce, peas, runner beans and spinach are all relatively tolerant of light shade"
https://www.rhs.org.uk/advice/profile?PID=934
Note though that my quote above refers to
light shade. The same link adds "Partial shade with some direct sun in midsummer can also be fairly successfully used to grow these vegetables", so you'd need to consider whether your location offers sufficient sunshine.