You're on the right path! If you want to store the messages in blob storage, you can follow this tutorial. It will store the messages in your Azure Storage Account. This is a built-in feature of IoT Hub.
However, you also mentioned:
Now I would to store this messages into a table
If by that you mean that you want to use table storage (available in CosmosDB or Storage Accounts), you will need to take a different approach. One such approach could be to use an Azure Function to listen to the IoT Hub built-in endpoint and use the CosmosDB/Storage Account SDK to put the messages in table storage.