Adding a TimeStamp in Azure Mobile Services


Buoyed on by the new App Builder reward program in the UK, combined with my attempts to loose weight (some little success with the 5:2 so far) I have developed a new App using the YouTube API to show a selection of feedback from users of popular diet programs. 

One of the things encouraged by this new program is the use of Azure Mobile Services.  Great! thought I, I have been keen to have another look at Azure for some time so this looks like the perfect opportunity.

I was surprised and encouraged by how easy it was to make use of  Mobile Services and managed to incorporate some logging into the App that I felt would be useful further down the line.

With a view to adding a future feature to the app I wanted to log favourites that were highlighted by users within the App (I may add an extra panorama item that shows the 10 most popular favourites for the App at some time in the future).

I was surprised how easily I was able to achieve my aim. I simply had to add the following script to the insert statement for the logging table:



This simultaneously created the new column and inserted a new date time value.  The operation->insert option offers similar functionality to a standard SQL server insert trigger (although the syntax is c# rather than T-SQL)


imageI should add that at this stage the ‘Dynamic Schema’ flag is still set to true (the default) which enables the above column to be added the first time an insert operation is attempted.

(Ordinarily this flag should be set to false when the App is submitted.  In reality I still have this flag set to true as the App has not yet been published in the store).




Now when I add a video to my favourites within my client App (as shown on the left, above).  A record is created in my back end table within Azure:



How easy was that?

You can download ‘Which Diet’ for free here once it passes certification (trial version is ad-enabled with nag screen)


~ by Ian on February 12, 2013.

2 Responses to “Adding a TimeStamp in Azure Mobile Services”

  1. […] Adding a TimeStamp in Azure Mobile Services […]

  2. […] Phone 8 for the Phone App I was curious to know how easy it would be to port similar functionality (outlined in this post) to Windows […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: