diff --git a/src/IoTHub.Portal.Server/Managers/ExportManager.cs b/src/IoTHub.Portal.Server/Managers/ExportManager.cs index 16c63c4dc..267af1165 100644 --- a/src/IoTHub.Portal.Server/Managers/ExportManager.cs +++ b/src/IoTHub.Portal.Server/Managers/ExportManager.cs @@ -290,9 +290,15 @@ private async Task ImportLoRaDevice( TryReadProperty(csvReader, newDevice, c => c.AppKey, string.Empty); TryReadProperty(csvReader, newDevice, c => c.AppEUI, string.Empty); - TryReadProperty(csvReader, newDevice, c => c.AppSKey, string.Empty); - TryReadProperty(csvReader, newDevice, c => c.NwkSKey, string.Empty); - TryReadProperty(csvReader, newDevice, c => c.DevAddr, string.Empty); + if (string.IsNullOrEmpty(newDevice.AppKey) && string.IsNullOrEmpty(newDevice.AppEUI)) + { + // ABP Settings + TryReadProperty(csvReader, newDevice, c => c.AppSKey, string.Empty); + TryReadProperty(csvReader, newDevice, c => c.NwkSKey, string.Empty); + TryReadProperty(csvReader, newDevice, c => c.DevAddr, string.Empty); + newDevice.AppEUI = null; + newDevice.AppKey = null; + } TryReadProperty(csvReader, newDevice, c => c.GatewayID, string.Empty); TryReadProperty(csvReader, newDevice, c => c.Downlink, null); TryReadProperty(csvReader, newDevice, c => c.ClassType, ClassType.A);