Sharon Nisha Thiruvarul Durai Greetings!
To delete the old data from your IoT hub, you can set the data retention period in Azure portal.
In the "Data Retention" blade, you can set the retention time for your data. You can choose to keep the data for a specific number of days or to delete it immediately. Once you have set the retention time, click on "Save" to apply the changes.
Regarding stopping the IoT hub from sending old data, you can stop the devices from sending data by turning them off, but the IoT hub will continue to receive and store the data until it is deleted. If you want to stop the IoT hub from receiving new data, you can disable the devices or remove them from the IoT hub.
To restart the IoT hub, you can use the Azure portal or Azure CLI. Here are the steps to restart the IoT hub using Azure CLI:
- Open the Azure CLI and log in to your Azure account.
- Run the command "az iot hub show --name {your IoT hub name} --resource-group {your resource group name}" to get the IoT hub connection string.
- Run the command "az iot hub restart --connection-string {your IoT hub connection string}" to restart the IoT hub.
Note that restarting the IoT hub will not delete the old data. You will need to follow the steps above to delete the old data.
Do let me know if that helps.