alan-turing-institute / data-safe-haven

https://data-safe-haven.readthedocs.io
BSD 3-Clause "New" or "Revised" License
61 stars 15 forks source link

Error messages when adding users could be more informative #2105

Open craddm opened 3 months ago

craddm commented 3 months ago

:white_check_mark: Checklist

:strawberry: Suggested change

The csv file used here was missing a final field (Country Code) for each user.

(data-safe-haven) deploydsh@0b11d89ae8c5:/workspaces/data-safe-haven$ dsh users add istorm_users.csv
You are logged into the Azure CLI as:                                                                                                                                                                 
        user: Matthew Craddock (1b2a59f2-f3ea-42e7-b8b8-aeea30572764)                                                                                                                                 
        tenant: turing.ac.uk (4395f4a7-e455-4f95-8a9f-1fbaef6384f9)                                                                                                                                   
Are these details correct? [y/n] (y): y
Could not add users from 'istorm_users.csv'.                                                                                                                                                          
Could not add users to Data Safe Haven.  

The error message is not very helpful for pinpointing the error. It could mean anything e.g. couldn't contact Entra, file formatted incorrectly, or elements missing

:steam_locomotive: How could this be done?

It'd be helpful if the error message was more specific - e.g. missing field, missing column, incorrect format, something like that.