Defending this canyon city against Siege doesn't entirely work with standard military practices, but it is very do-able. You do have a lot of positive things going for you, so we'll start with those. The fact that you mentioned that it's in a desert and that this is a fantasy world helps. A lot.
Good Stuff
Water supply
Assuming you have a proper river in your canyon, not some mostly-dead stream, you have a water supply that is very hard to mess with. Because...
- Once a river has dropped into a canyon, diverting it back out of the canyon is impossible. Any attempt to cut off your water supply would require them to travel all the way to wherever the river first drops into the canyon, then travel far enough up-stream that it won't just flow around your obstruction and drop back into the canyon anyway.
- Poisoning an entire river is HARD. You need a constant, high-volume inflow of toxins, because the toxins keep getting washed away and diluted by the massive volume of water that is moving through there. It's not like a well, where you can toss some corpses in and call it a day.
Historically, the city of Babylon was built straddling a river and took full advantage of the second point. It was taken after the Persians diverted the river and came in through the water grates. But as long as the canyon you're in is significantly longer than your city is...they're going to have a hard time plugging it up.
That said, you want to divert some of that river down into some unused tunnels to serve as a back-up cistern. People have turned islands into peninsulas in the name of capturing a castle...so don't assume your river is invincible.
Food
Using D&D as an example here...there are entire civilizations in your typical fantasy setting that live completely underground and grow all of their food in the complete absence of sunlight (see: The Entire Underdark).
If Dwarves can have vast cities that can feed themselves without ever seeing the sun, you can do the same. You really don't need to worry about running out of food at this point.
So, don't just rely on your terrace farms...go talk to them dwarves and get your hands on subterranean crops. Make use of all those tunnels you dug out looking for valuables, and grow food.
Stone Construction
The buildings of your city aren't flammable. This is good. The walkways and stuff (detailed far below) may be...but that's fine, they're supposed to get destroyed in a siege.
The Desert
You mentioned that Hurr resides within the desert of Durr. Deserts are phenomenal natural defenses. Little rain means little plantlife means little animal life...which means that an invading force is going to have a hard time finding food.
Additionally, if you in a hot (or cold) desert, the invading force has to worry about exposure to the elements. Heat Stroke will be a very real risk to them. Just getting an entire army to Hurr will be difficult, not to mention having to lug siege engines along with you (because there are no trees near Hurr apart from what may be growing down in the canyon). Thus, an invading army is only going to have what lives along the river as forage. They'll strip that bare pretty quickly. And, the bigger this desert is, the further they are going to have to travel to find provisions or ship them in.
Encirclement is nearly impossible
If this plateau/mountain is large enough to contain a massive canyon with a big city in it...it's huge. The enemy force is going to have a really hard time encircling the entire thing. If you have hidden passages that lead out of the mountain, you can probably come and go almost as you please. This continues to apply even if they take the top of the plateau.
The more easily you can slip out of your city without being caught, the more easily you can sneak around and set all their stuff on fire. Or sneak in provisions.
Bad Stuff
If they get on top the 'mountain,' your city is in trouble. And the mountain is BIG
Standard medieval military doctrine is that being on high ground is better. You can see further, shoot further, drop stuff on your foes, etc. Gravity is working for you when you have the high-ground.
Even if the canyon is in it's own little stand-alone plateau, you don't need to put a large army on top in order to cause some serious havoc. A double-line of archers firing down into the city would rapidly kill anyone exposed. And a tall canyon would result in the people on the floor of the canyon having an extremely hard time firing projectiles up at the top.
You're going to have to defend the entire mountain as if it were walls. If enemies reach the top, they can attack your gates from above, or just skip past the gates and start attacking your city. All they need to do is get a small team up the cliffs somewhere you don't catch them, and they are going to wreak all manner of havoc. (Kill the crew of a few guard towers to provide a 'blind spot' for more troops to scale the wall. Get behind the gates and open them. Dress like your people and set fire to farms and poison cisterns. And so on.) And if they can 'take' the top of the plateau, they're going to start getting siege engines up there to fire down into your city.
In short...your outer wall is vast and you have to defend the whole thing.
If you can field enough troops to properly man the cliffs...then this place becomes massively defensible...but this mountain sounds huge.
Effects of the above
Long-duration sieges favor the city
Any attempt to starve you out is going to go poorly. To starve out a fortification, the attackers need to have enough provisions to outlast the defenders. Because of Hurr's location within the desert of Durr (and the existence of fantasy-style dwarf crops), the city must be mostly self-sufficient, and can keep a good sized chunk of back-up farms safely in tunnels accessible from within the city.
So the attacker is sitting in a desert with a very limited ability to forage. They can forage along the river where it leaves your canyon, and that's about it. Meanwhile your city has spent the bulk of its existence living on what it can grow in the tunnels and along the river. They are not going to outlast you. Their only option is to assault the city.
Physical Defenses
- Set your gates back inside the mouth of the canyon a bit. This limits the angles from which your gates can be fired upon with siege weapons. Make sure there are towers either carved into the walls, or sitting on top of the edges of the canyon overlooking this little path leading to the front gate. If you can force enemies into a 3-sided death-box to assault your gate....they probably aren't taking that gate by storm. Make sure there are grates for water to get through...you'll need to defend these vigorously, as they are points of vulnerability.
- You need to treat the outer cliffs of the mountain this canyon is carved into like walls. Build towers, man them, kill anyone who tries to come up the the side. If you can have your diggers work to 'smooth' the outside of the mountain to make it harder to climb, that is also good.
- Routes from the lip of the canyon to the city should be destructible. If the enemy takes the plateau, you don't want them to be able to just walk their way down
- Build entrances to buildings above 'ground level.' Build ramps, walkways, bridges, etc. to provide access to and from the floor of the canyon. You have lots of money from the precious ores and gems you're harvesting...import that wood. Don't have too many of these, though...you don't want to give the enemy too much in the way of combustibles to target.
- Buildings should be interconnected inside the walls. Think fortress here...choke points are your friend. Try to tunnel under the river if you can dig deep enough, so the two sides of the city are connected. Choke points should be rigged so that you can cave them in if you're losing them.
- Build important stuff like archer posts in narrow parts of the canyon. Typical anti-wall siege weapons (catapults/trebuchets) fire in a parabolic arc. A narrow stretch of the canyon will interfere with this arc and prevent topside-based weapons from hitting your buildings without a lot of work
- Additionally, put really important stuff deeper inside the walls where outside projectiles can't hit.
- Air vents, Air vents, Air vents. You have dwarvish-level digging tech: drill lots of tubes leading to random spots along the walls of the canyon so that smoke can get out and fresh air can get in if they collapse your entrances. Or, y'know...build fires in your entrances. Which is generally the best way to wipe out everything hiding in a cave
- Route parts of the river into underground reservoirs. In case someone takes the canyon floor, you want a back-up supply of water.
Tactics
Your goal in defending this city is to draw this siege out as long as possible. The longer you make this drag on, the more enemies the desert will kill for you. Between the river and your fantasy-style dwarf farms, you're in good shape for a prolonged siege.
Your walls (both the ones you made, and the walls of the mountain) should be defended in typical siege-style. Archers, boiling oil, the works. Your enemy is going to have a hard time building siege engines in a desert, and undermining is probably not happening against the very limited wall-area they can target.
Any attempt to flood you out is limited by there being multiple water-exits from the canyon, and the fact that waiting for the entire canyon to fill with water would take a long time and, again, time favors the defender when you're in this situation.
However, in a serious siege, the enemy is likely going to take the top of your mountain/plateau thing. It's just too big to fully defend, and someone is going to get troops past your defenses.
Frankly...that's fine. Pull all your forces back inside the buildings and tunnels of the city. Do NOT under any circumstances attempt to defend the floor of the canyon. You've lost your 'walls;' any attempt to hold there will be a slaughter. On your way in, destroy the access ramps coming down from the cliffs and up from the floor.
Now....the enemy gets to die in large numbers. In order to assault the buildings of your canyon city, they have to march into the canyon to assault the actual buildings. Sure, they can bombard you with any siege weapons they get up on top of the lip...but their targets will be limited by parabolic arcs and the difficulty of getting heavy siege equipment up on top of the mountain. Naturally, you should try to set those on fire whenever possible.
Ultimately, to take a city, you have to take the buildings and deal with the people. And you guys are holed up with your supplementary dwarf-style food production and entire caves full of water. And any time their army comes down into the canyon, they are walking into a narrow space with enemies possessing the high-ground on both sides of them. Rain down arrowy death.
If they do get inside, then we're on to tunnel warfare. Make good use of those choke points. Just plug em with corpses. Their best option for getting you out is to smoke you out...but that's what all the air-vents are for. They're going to have to go climbing around the walls of the canyon (likely while under fire from the other side of the canyon) trying to plug all the holes, or try to hit them all with siege engines and hope they collapse them, rather than just take a few layers off the outside.
Summary
Trying to defend such a place in real life would be hard...because city-supporting underground crops don't exist, and the middle ages didn't have dwarven levels of digging technology (such as being able to bore breathing hole tunnels). IRL, once you take the top of the mountain...battle is over. They just cave in your entrances and let you starve of suffocate. Or they lob big piles of burning stuff at your entrances, smoke you all out, and either just let you burn, or pick you off when you come running out.
A Plateau is wonderfully defensible if it is relatively small. Masada was, historically, one of the most invincible fortresses of all time. In no small part because it was built atop a plateau. But, said plateau was only 550m x 270m. Mount Conner is 3km by 1.2km...a vastly larger perimeter to defend. And to have such a canyon system with a full city inside it...yours is probably even bigger. Your enemy is going to have a hard time getting up there, but once they do your outer defenses are toast. And so, in terms of tactics...you plan for that. Try to keep them from taking the mountaintop, of course, but design the city such that trying to actually invade it forces them into a killbox.