If you have worked with the Azure Cloud Shell in the last couple of days, you might have seen a new button called Web Preview. The Azure Cloud Shell Web preview feature allows you to run web applications on the Cloud Shell container instance and preview them before you deploy them. You can run web applications that listen to HTTP requests on the Cloud Shell from port 1025-8079 and 8091-49151.
If you are running for example a .NET Core application in Cloud Shell, you can preview this to the Cloud Shell gateway.
I have created a short video tutorial to show you the Azure Cloud Shell Web preview feature.
How to use the Cloud Shell Web Preview
First you need to run your application, in my case I run a simple .NET Core web application. This also works with other applications which can run in Cloud Shell and can map a local port.
By default, this will use port 5000. Now you can create a simple port mapping by clicking on the Web Preview button in Cloud Shell.
This will open up the configuration menu to create the port mapping, where you can select port to use from 1025-8079 and 8091-49151.
Now you can access the application running inside your Cloud Shell container through the gateway, to preview your application.
I hope this was helpful and gave you a quick overview about the Web Preview feature in Cloud Shell. If you have any questions, please let me know in the comments.
If you want to learn more about Cloud Shell, check out my video about Mastering Azure using Cloud Shell.