Hello @jiah xie ,
As I understand, you used a shared private key before. Thus, if you use create_device_with_sas
you should be fine. The only thing to change is skipping auth_method and providing the targeted device state (enabled/disabled).
azure-iot-sdk-python v1.4.6:
new_device = iothub_registry_manager.create_device(DEVICE_ID, primary_key, secondary_key, auth_method)
With the current sdk version
new_device = iothub_registry_manager.create_device_with_sas(device_id, primary_key, secondary_key, device_state)