Thank you, could you try to adapt the below code instead? If this doesn't help it would also be good if you could paste your exact code minus any uniquely identifiable information.
private async Task<string> MoveDeviceGroupAsync(string accessToken, string tenant, string deviceid, string devicegroup, CancellationToken cancellationToken)
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
Uri uri = new Uri(AzureSphereApiUri, String.Format("v2/tenants/{0}/devices/{1}/devicegroup", tenant, deviceid));
using (HttpResponseMessage response = await client.PutAsync(uri, JsonContent.Create(devicegroup), cancellationToken))
{
response.EnsureSuccessStatusCode();
return await response.Content.ReadAsStringAsync();
}
}
}