Blue Monday: MySQL Native In Web Apps; Use JSON In SQL Server

New this week in Microsoft Azure service updates of interest to .NET developers: JSON support for Azure SQL Server is generally available.

In addition to supporting basic insert and update actions, you can now retrieve standard SQL recordsets as JSON.

This makes pumping data back and forth pretty straightforward if you’re mostly interacting with client-side applications, although I would remind you to never trust client-side data and always sanitize (and, if necessary, normalize) your inputs, regardless of their origin.

I’ve been considering DocumentDB as an option but its lack of support for Entity Framework, coupled with my long experience with SQL Server and my general need to ensure concurrency in records, has made me reluctant. Now that SQL Server can transact business in JSON, it’s another reason to delay DocumentDB implementation for most folks, I’d imagine.

I’ll be giving JSON support in Azure SQL Server a go at some point in the near future and will let you know how it turned out. Or, if you have experience with it, drop a comment and let us know about it.

MySQL available in Web Apps

In preview is MySQL in-app, a way to run a MySQL instance directly within your Azure Web App.

I’m really excited about this development. While I build almost exclusively in .NET these days, sometimes I make things in PHP; either because I’ve inherited something, or I just want to bang out a quick-hit, light-duty single-page app in knockout.js. Plus, the rest of my team is more comfortable in PHP, so if I am architecting something they need to take over, I can do the framework in PHP and there’s no problem for them to flesh it out.

While Web App’s support for PHP is outstanding (more on that shortly), running MySQL has meant either spinning up a VM (hello, server management headaches) or using ClearDB, Microsoft’s partner for MySQL PaaS.

I’ve opted for ClearDB in the past and while their product is very reliable, managing those servers through the Azure portal is error-prone, and more often than not requires you to go to the ClearDB portal instead.

Also, the pricing on ClearDB databases is ludicrous. So it’s nice to finally have MySQL as an option that’s native to the Web App.

That said, there’s a huge limitation: MySQL in-app can’t scale out and you can’t access it remotely.

That means your data is hostage to a single instance of the Web App. If you want to get it out, or keep it in sync with a second Web App, you’ll need to do something like run a Web Job.

But if all you need is a simple WordPress test install, or something that’s fault tolerant, MySQL in-app is a welcome development.

PHP upgrades coming, could break code

Previously Azure announced that it would end support for PHP 5.4 in October, making PHP 5.6 the default version.

Azure has also begun updating default PHP runtimes in Web Apps to patch some security holes.

These updates are taking place now, so if you have PHP-based Web Apps running, you need to check your code and make sure these patches don’t break your site.

Also of note: PHP 7 is generally available , and that install includes a SQL Server PDO driver by default.

If you have customized your php.ini to load your own SQL Server PDO driver in the Azure stock build, you need to remove that instruction, since your custom driver will cause errors.

Storage indexers for Azure Search in preview

Azure Search is a powerful, lucene-based search engine that amazingly, until now, didn’t directly support the indexing of Azure Storage blobs or tables.

That means that Office documents, HTML / XML, text files, PDFs and the like that you have as blobs, and your table records, can be selected from the portal and indexed directly from your Search instances.

Additionally, version 2.0 of the Azure Search SDK is in preview.

Image recognition, academic search API support

Azure has put support for the Computer Vision API and Academic Knowledge API into preview.

Computer Vision API is basically a tagging system for images; you can identify people, places and events for entire photos or sections of a photo, and attach tags to those things. You can also use that information to intelligently crop pictures, extract text from a photo and automagically identify “celebrities” from a list maintained by Microsoft.

Academic Knowledge API is also a kind of tagging system around — you guessed it — academic works and scholars. In this case, you can build queries that return papers, people, disciplines, etc. related to your terms.

Odds and ends

Featured photo by lannyboy89 via Pixabay, in the public domain.
Featured photo by lannyboy89 via Pixabay, in the public domain.

Leave a Reply

  • Check out the Commenting Guidelines before commenting, please!
  • Want to share code? Please put it into a GitHub Gist, CodePen or pastebin and link to that in your comment.
  • Just have a line or two of markup? Wrap them in an appropriate SyntaxHighlighter Evolved shortcode for your programming language, please!