For the Azure resources configured with static IP addresses, Site Recovery will assign the same IP address if that is not in use in the target VNet.
Refer: https://learn.microsoft.com/en-us/azure/site-recovery/site-recovery-retain-ip-azure-vm-failover
Also you can configure IP address settings by yourself. Refer the following article.
The public IP can not be retained on failover. Refer https://learn.microsoft.com/en-us/azure/site-recovery/azure-to-azure-network-mapping#set-up-ip-addressing-for-target-vms
Hope this helps