@UK Welcome to Microsoft Q&A forum!
When I try to get the required SAS-Token with command:
az iot hub generate-sas-token -d <DeviceId> -n <MyIoTHub>I get error:
'generate-sas-token' is misspelled or not recognized by the system.
You get these type of errors when Microsoft Azure IoT extension for Azure CLI is not added to the Azure CLI.
What is the CLI version you are using and can you confirm if you have added the Microsoft Azure IoT extension for Azure CLI?