This is a tough issue, but there's a few approaches:
Create a tool that scans all your documents/pages, looks for media URLs and updates them to the new format
Create an MVC Action Filter to scan the HTML output for media URLs and dynamically update them.
Keep the existing media library using local storage so that the URLs are not changed, but then create a new media library, and map that one to Azure storage. This will allow using Azure Storage for new media, without having to update all the URLs pointing to existing media.