These spaces need more protection than an ordinary open topped pergola can give so fixed roof pergolas are the perfect solution.
Roof to fence shade cloth.
The panels are uv resistant and offer shade and protection from rain and snow as well.
Attach shade cloth to one of the longest sides first the edge closest to your house.
Note that canopies and awnings are sold at most home center and garden supply stores and are available online.
Start at one end and pull with medium pressure enough to get the wrinkles out and just a bit more as you move along the edge.
The shade awnings are available in two roof styles a hip roof and a pyramid roof and several colors.
Attach about every 12 18 inches.
You can install outdoor lighting on the framework to illuminate your deck or patio awning.