Tuesday, 14 March 2017

Azure Portal - Web-based code editor for App Services



A feature that caught my eye is the App Service Editor, a preview addition to the Development Tools section of the navigation bar of your app in the Azure Portal.

In essence it is a web-based editor for App Service. That's right, you can edit and save your web site LIVE with a clean, easy to use, web editor!

We have already come to love the Visual Studio Team Services code editor, which allows code and config edits pre-deployment but this feature is production level, post deploy / release. Cannot stress how useful this is for quick fixes and post deployment edits which would otherwise mean re-deploying or falling back to FTP. Project Kudu has been around for a while now but great to see it appearing as a first class citizen in the portal. The underlying functionality is provided by the Monaco Editor, which powers Visual Studio Code.

It is worth noting that if Continuous Integration (CI) has been enabled for your application, that the next build will overwrite your changes. But that is what you would expect, any changes made using the editor would need to be fed into your code repository / build workflow.



Code Editor

To access the editor, simply type 'App Service' or go to App Service Editor (Preview) in the Development Tools section of the left-hand navigation of your app. (see below)





After selecting 'GO' a nice tree view of your sites assets is visible along with the editor and options to view split pane and changes.


Search Features

There are a number of a really good search features, below are the results of my query text 'sitemap'. As toy can see it not only found the set of sitemap files, it also discovered the robots.txt.




There is also a nice 'Go to File...' button which give a context based search dialog



Code Repository Integration

Another great feature of the editor is the ability to hook up your repo from either a GIT source or Visual Studio Online. Then you can benefit from all the goodness of having the repository commands right from within the editor. 




Command Console

Backing up the GUI and driving the underlying command experience is the command console.



Typing 'help' in the console gives a list of available commands.


There is a lot that can be performed with that set of commands. Expect more commands to appear as other services are associated with your application.

Output

To support the commands and output of your application is the output window. It provides an ongoing set of information, warnings and errors, based on the logging level set. You will also see custom log output from your application.


Conclusion


The benefits of this new feature are clear for all to see and can mean the difference to being able to react immediately to certain scenarios or not. Obviously with this power does come responsibility and more than the usual care is required before committing changes with wide reaching impact. But if used conservatively, under the right circumstances and by those with the domain knowledge to understand the impact, it is a superb tool to have in your back pocket.



Available to discuss your next project.