SEO Impact of moving the subfolder of a website to the root folder

I have a website example.com/blog/a-random-post. It’s already indexed on Google Search and Bing Search.

I’m working to change the host provider to Google Cloud but am worried about the impact it could have on search engines to find it because the new URL would be example.com/a-random-post.

PS: I couldn’t add the subfolder on Google Cloud, so that’s the reason I’m willing to remove the /blog subfolder.

Can someone help?