Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2026-01-14 00:00 | #250 | in_progress |
Clean
|
| 2026-01-13 00:00 | #246 | completed |
Clean
|
| 2026-01-11 00:00 | #240 | completed |
Clean
|
| 2026-01-10 00:00 | #237 | completed |
Clean
|
| 2026-01-09 00:34 | #234 | completed |
Clean
|
| 2026-01-08 00:53 | #231 | completed |
Clean
|
| 2026-01-06 18:15 | #225 | cancelled |
Clean
|
| 2025-09-11 00:00 | #108 | completed |
Clean
|
| 2025-08-11 00:00 | #77 | completed |
Clean
|
| 2025-08-10 00:00 | #76 | completed |
Clean
|
| 2025-08-09 00:00 | #75 | completed |
Clean
|
| 2025-08-08 00:00 | #74 | completed |
Clean
|
| 2025-08-07 00:00 | #73 | completed |
Clean
|
| 2025-08-06 00:00 | #72 | completed |
Clean
|
| 2025-08-05 00:00 | #71 | completed |
Clean
|
| 2025-08-03 00:00 | #69 | completed |
Clean
|
| 2025-07-13 21:37 | #48 | completed |
Clean
|
| 2025-07-12 23:44 | #41 | cancelled |
Biased
|
| 2025-07-09 13:09 | #3 | cancelled |
Clean
|
| 2025-07-08 04:23 | #2 | cancelled |
Biased
|
1. Right-click on the project *ImportExportDevicesSample* and select **Set as startup project**. 1. Set the variables at the top of Program.cs in the ImportExportDevicesSample folder for the five options.
### Use environment variables for the connection strings 1. To run the sample, you need the connection strings to the old and new IoT hubs, and to a storage account you can use for temporary work files. We'll store the values for these connection strings in environment variables. 1. To get the connection string values, sign in to the [Azure portal](https://portal.azure.com). 1. Put the connection strings somewhere you can retrieve them, such as NotePad. If you copy the following, you can paste the connection strings in directly where they go. Don't add spaces around the equal sign, or it changes the variable name. Also, you don't need double-quotes around the connection strings. If you put quotes around the storage account connection string, the script fails. Set the environment variables in Windows:
1. For the IoT hub connection strings, go to each hub in the portal. You can search in **Resources** for the hub. If you know the Resource Group, you can go to **Resource groups**, select your resource group, and then select the hub from the list of assets in that resource group.
1. Select **Shared access policies** from the Settings for the hub, then select **iothubowner** and copy one of the connection strings. Do the same for the destination hub. Add them to the appropriate SET commands.
1. For the storage account connection string, find the storage account in **Resources** or under its **Resource group** and open it.
1. Under the Settings section, select **Access keys** and copy one of the connection strings. Put the connection string in your text file for the appropriate SET command.
Now you have the environment variables in a file with the SET commands, and you know what your command-line arguments are. Let's run the sample.
### Run the sample application and using command-line arguments
1. Open a command prompt window. Select Windows and type in `command prompt` to get the command prompt window.
1. Copy the commands that set the environment variables, one at a time, and paste them into the command prompt window and select Enter. When you're finished, type `SET` in the command prompt window to see your environment variables and their values. Once you've copied these into the command prompt window, you don't have to copy them again, unless you open a new command prompt window.
1. In the command prompt window, change directories until you are in ./ImportExportDevicesSample (where the ImportExportDevicesSample.csproj file exists). Then type the following, and include your command-line arguments.
### Run the sample application using Visual Studio 1. If you want to run the application in Visual Studio, change your current directory to the folder where the azureiot.sln file resides. Then run this command in the command prompt window to open the solution in Visual Studio. You must do this in the same command window where you set the environment variables, so those variables are known.