Yes, using the device twin desired properties to store runtime data in the cloud and persist it across device restarts and replacements.
The device twin is a JSON document,
stores metadata and configuration information.

To update the desired properties from Edge device application, use the Azure IoT SDKs to send a device twin update message to the cloud. The message should contain the updated desired properties for the device twin.
When replacing the Edge device, you can create a new device twin with the same desired properties as the old device twin, and the runtime data will be restored. And also update the desired properties of the device twin from Edge device application to persist changes done.
To copy the device twin from the old device
-Use the Azure IoT Hub REST API or the Azure IoT SDK.
Mydevice_client = IoTHubDeviceClient.create_from_connection_string(connectionSTring);
desired_properties = {
"property1": "value1",
"property2": "value2"
}
- The Edge device application has the necessary permissions to read and write to the device twin. And configure the permissions using Azure IoT Hub access policies.
For more information refer to the MSDoc.