Steps to migrate to provider azurerm v3.0.2

I followed this tutorial but the command

$ echo | terraform console
$ echo | terraform console

does not work if you have modules.
The command terraform console allows you to access to the output of the resources but for the modules, you need to explicitly export the id as an output

Is there a way to get the id of a resource by its address without having the need to modify the output of modules if you did not exported the ids?
Right now, to get the id, I am fetching the state as json with terraform show -json then I parse the json to filter by address and I retrieve the id from the values property.
Is there a better way?
May be a new command in the terraform cli would be great!