You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS, version, SKU and CPU architecture used: Windows 10 Desktop x64, Azure App Service (Linux based)
Application's .NET Target Framework : net8.0
SDK version used: Microsoft.Azure.Devices.Provisioning.Service 1.18.4
Description of the issue
The DPS SDK contains wrapper methods around two DPS APIs:
(a) query all enrollments for a DPS instance
(b) get a single enrollment from the DPS instance
Method (b) works correctly, but when using version (a), the enrollment objects are all missing the RegistrationState information. This causes us to have to retrieve each individual enrollment rather than querying the list once and using the information as-is.
Code sample exhibiting the issue
ProvisioningServiceClient provisioningServiceClient =
ProvisioningServiceClient.CreateFromConnectionString("<insert_connection_string_here>");
IndividualEnrollment goodResult = await provisioningServiceClient.GetIndividualEnrollmentAsync("<pick_a_regstration_id>");
// here, goodResult.RegistrationState is a valid object containing IoT Hub assignment details
Query query = provisioningServiceClient.CreateIndividualEnrollmentQuery(new QuerySpecification(string.Empty));
while(query.HasNext())
{
QueryResult result = await query.NextAsync();
IReadOnlyList<DeviceRegistrationState> badResults = result.Items.OfType<IndividualEnrollment>()
.Select(enrollment => enrollment.RegistrationState).ToList();
// here, every item in badResults will be null
}
The text was updated successfully, but these errors were encountered:
Context
Description of the issue
The DPS SDK contains wrapper methods around two DPS APIs:
(a) query all enrollments for a DPS instance
(b) get a single enrollment from the DPS instance
Method (b) works correctly, but when using version (a), the enrollment objects are all missing the
RegistrationState
information. This causes us to have to retrieve each individual enrollment rather than querying the list once and using the information as-is.Code sample exhibiting the issue
The text was updated successfully, but these errors were encountered: