Blogging about Royal TS/X, Royal Server and Royal Passwords

Integrate Royal TS with Project Kudu

What the heck is Kudu? – you may ask. Well, if you are running web site(s) on Windows Azure, you should read on and learn how you can not only leverage Kudu but also how to integrate it in your workflow using Royal TS. Even if you do not use Windows Azure web sites, you might still find the blog post interesting as it demonstrates some powerful features of Royal TS.

About Kudu

Scott Hanselman blogged about how easy you can see Trace output of Windows Azure hosted Websites here. I’ve blogged about the backend that is making all this work: Project Kudu. Project Kudu is an open source project from Microsoft that is the backend of their Git deployment of Azure Websites. It’s very easy to integrate this in your Royal TS workflow and have Kudu at your fingertips…

Integrate the Kudu project page as a Web Page

Since you need to authenticate to the Kudu page, we will first prepare a Credential: Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image002_2[1]

For the Kudu project URL you need to use the following URL scheme: https://<your-website-name>.scm.azurewebsites.net/

So let’s create a new web page with the URL:
Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image004_2[1]

Now, let’s assign our previously created credential to the web page:Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image006_2[1]

Next, click on Advanced. Its important that you specify to use Basic Authentication for this:Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image008_2[1]

And here you go :)

Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image010_2[1]

From there you can monitor the log stream (diagnostic log stream) or open the diagnostic console:Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image012_2[1]

Integrate the Kudu project page as a Template

If you have many Azure web sites, you probably don’t want to define a new Web Page for each Kudu page. Assuming that your Azure web sites are already configured in Royal TS, you can use custom fields to store the Kudu page address for each Azure web site. Then, just create a Template which opens the Kudu project page based on that custom field.

For this we need to store the Project Kudu URL in a Custom Field in your Web Page Connections:
Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image014_2[1]

Remark: Note that the “Custom Field 1” was renamed to “Kudu Project Page” – you can do this easily through editing the Default settings:Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image016_2[1]

Then, you create a Web Page Template. To do this, go to the Ribbon Tab “Edit” -> “Add New Template” -> “Web Page“.
Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image018_2[1]

Define $CustomField1$ as URL and to make sure configure the same settings as shown in the first section (Credential, Basic Authentication):Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-2013-12-09_12_57_55-Edit_Template_Properties__Azure_Kudu_Project_URL_2[1]

After this, you can connect to every Azure-hosted Web site via this template and directly go to the Kudu Project site.Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image020_2[1]

Integrate the Azure Logstream as an External Application

The Azure log stream is a very helpful tool to diagnose issues with your web site. Developers can easily write to the log stream from within their application. You can also directly connect to the Azure Logstream via curl (or similar command line tools), in my case something like this:

curl -u sargola_deploy https://azurelogstreaming.scm.azurewebsites.net/logstream -k

If you execute the curl command, you will be prompted to enter the password. Using Key Sequence Tasks in Royal TS you can still fully automate executing curl end even let Royal TS enter the password for you.

Let’s define a Key Sequence Task:

Via the “Edit” Ribbon Tab and add a “Key Sequence Task” you specify it like this:Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-2013-12-09_13_10_34-Edit_Properties__Azure_Logstream_curl_2[1]

Then add an External Application:

Command: cmd.exe
Arguments: /k “[PATH-TO-CURL] curl.exe –u $EffectiveUsername$ https://[websitename].scm.azurewebsites.net/logstream –k” 
Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-2013-12-09_12_55_23-Edit_Properties__Azure_Logstream_via_curl_2[1]

Also make sure you assign the credential (we prepared in the first section) to the External Application!

Then reference this Key Sequence Task in your External Application:Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image024_2[1]

And now you get any trace-messages from your Web site directly in this command line:Windows-Live-Writer-Integrate-Royal-TS-with-Project-Kudu_B071-clip_image026_2[1]

I was unable to find any limitations of the log stream feature besides the information Scott Hanselman mentioned in his blog (http://www.hanselman.com/blog/StreamingDiagnosticsTraceLoggingFromTheAzureCommandLinePlusGlimpse.aspx):

– Tracing is turned on for 12 hours

– You can and should specify the log settings (log files, names, sizes, etc.)

Upcoming Royal TS Feature

We get numerous feature request that point in the direction of having a second/custom dashboard functionality based on an URL that is based on some connection property (like the host name). In the next major release we have a couple of improvements and enhancements on the roadmap which will further simplify your daily work for scenarios like this.

cheers,
Michael



You must be logged in to post a comment.