Regenerate shared access policy keys
Shared access signatures are one way to grant permissions at the service or device level. This article describes the process to regenerate those keys when you need to renew them in your applications. For more information, see Control access to IoT Hub with shared access signatures.
Regenerate service keys
Every IoT hub comes with a set of default shared access policies that grant permissions to service-facing endpoints, device-facing endpoints, or the identity registry. You can also create your own policies. For more information, see IoT hub-level shared access policies.
In the Azure portal, navigate to your IoT hub instance.
In the IoT hub menu, select Security settings > Shared access policies.
Select the policy for which you want to regenerate keys.
In the policy details page, select either Regenerate primary key or Regenerate secondary key.
Select Yes to confirm that you want to regenerate the key.
Regenerate device keys
When you register a device to use SAS token authentication, that device gets two symmetric keys.
In the Azure portal, navigate to your IoT hub instance.
In the IoT hub menu, select Device management > Devices.
Select the device for which you want to regenerate keys.
Select Manage keys.
Choose either Regenerate primary key or Regenerate secondary key from the drop-down menu.
Select Proceed to confirm that you want to regenerate the key.