Hello @Mistyron ,
welcome to this moderated Azure community forum.
The supportbundle call is basically just a way to execute a number of direct methods on the edge agent module.
As seen in this post, you first need to call 'UploadSupportBundle', follow by one or more 'GetTaskStatus' calls until you get the response with status 'completed'.
I'm not sure what ELMS is but you can use code to trigger direct methods using the IoT Hub Service SDK.
This could be done using eg. an Azure Function.
Based on this sample, I created this (untested) C# code:
private static async Task InvokeMethodAsync(string deviceId, ServiceClient serviceClient)
{
var methodInvocation = new CloudToDeviceMethod("UploadSupportBundle")
{
ResponseTimeout = TimeSpan.FromSeconds(30),
};
methodInvocation.SetPayloadJson("[THE DEFAULT PAYLOAD OF THE UploadSupportBundle CALL]");
Console.WriteLine($"Invoking direct method for EdgeAgent on device: {deviceId}");
// Invoke the direct method asynchronously and get the response from the simulated device.
CloudToDeviceMethodResult response = await serviceClient.InvokeDeviceMethodAsync(deviceId, "edgeAgent", methodInvocation);
Console.WriteLine($"Response status: {response.Status}, payload:\n\t{response.GetPayloadAsJson()}");
}
You make use of this Nuget package (or a more recent one):
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
Make use of the connection string of the IoT Hub, not the device (and keep it secure).
Notice that you still need to fill in the right payload for this call.
Notice also that next to the device name, the module name can be passed on (great for modules on edge devices).
I'm also not sure if the 'edgeAgent' is correct, please try '$edgeAgent' too.
This should give you a good starting point.
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.