A package containing abstractions for Microsoft Azure Sphere Device REST APIs
$ dotnet add package Microsoft.Azure.Sphere.DeviceAPIMicrosoft Azure Sphere Device REST APIs enables users to interact with an Azure Sphere device using REST APIs. This is useful during manufacturing operations.
using Microsoft.Azure.Sphere.DeviceAPI;
internal class Program
{
private static void Main(string[] args)
{
string result = Devices.GetAttachedDevices();
Console.WriteLine($"Devices result: {result}");
string networks = Wifi.GetAllConfiguredWifiNetworks();
Console.WriteLine($"Wifi networks: {networks}");
}
}
Ensure you have the .NET Runtime and SDK installed for your platform.
Create a folder to contain your C# project
cd to your newly created .NET project folder
Create a new .NET console application: dotnet new console
Install the package from nuget: dotnet add package Microsoft.Azure.Sphere.DeviceAPI
Install Visual Studio
Follow the guide to add a nuget package to a Visual Studio project.
Before using Microsoft Azure Sphere Device REST APIs for CSharp, you must install the Azure Sphere SDK.
The DeviceApiSample gets the list of attached devices, displays the device IP address, and device ID.
View the package API documentation on Github.