Introduction
Azure IoT Hub is a cloud gateway which supports open source SDKs and multiple protocols. IoT Hub communicates both ways - devices to cloud and cloud to devices. The IoT Hub monitoring helps to check device health, failures, and device connection status.
Please read the previous parts of the series before continuing with this one.
- How To Create Azure IoT Hub Using PowerShell
- How to Register IoT Device in Azure IoT Hub Using PowerShell
- How To Send Telemetry From An IoT Device To The Azure IoT Hub Using C#
- How To Configure Message Routing With IoT Hub - Part One
- How To Configure Message Routing With IoT Hub - Part Two
- How To Setup Diagnostic Logs With An IoT Hub
Creating a C# Console Application
-
Open Visual Studio -> choose to create a new project.

-
Select Console App (.NET Core) and click "Next".

-
Enter the project name, location, and solution name.
-
Click "Create".

Installing Microsoft.Azure.Devices NuGet package
-
Go to Project -> Manage NuGet Packages.
-
Click the "Browse" tab and search for Microsoft.Azure.Devices. You will see Microsoft.Azure.Devices SDK listed in the search results; click the "Install" button.
-
Now, click the "I Accept" button to accept the license agreement.
-
It will take a few minutes to install the SDK in our project.

Get IoT Hub Connection string from Azure IoT Hub
-
Open your Azure portal and choose your IoT Hub.
-
Click "Shared access policies" in "Settings". You can see the list of policies to the IoT Hub.
-
Double click the iothubowner policy and copy the connection string from the Shared access key.




Muralidharan VPosted May 12, 2020, 11:01 PM
How to remove the bulk devices in IoThub
Muralidharan VPosted May 9, 2020, 2:49 AM
Severity Code Description Project File Line Suppression StateError CS5001 Program does not contain a static 'Main' metSeverity Code Description Project File Line Suppression StateError CS5001 Program does not contain a static 'Main' method suitable for an entry point BulkDevicesRegistrartion hod suitable for an entry point BulkDevicesRegistrartion
Karthik KasulaPosted Dec 11, 2019, 6:59 AM
I am facing these error:Microsoft.Azure.Devices.Common.Exceptions.UnauthorizedException: '{"Message":"ErrorCode:IotHubUnauthorizedAccess;Unauthorized","ExceptionMessage":"Tracking ID:8a332d7bec3b48e5bf467779ed8f47e1-G:3-TimeStamp:12/11/2019 12:58:04"}'
bala bhuvanPosted Sep 9, 2019, 7:34 AM
IotHubCommunicationException: An error occurred while sending the request. Getting this error. I tried many times