Cheat for azure free-plan webapp “always on”

So I’m not allowed to use the “always on” switch?

I’m running a simple website from Azure. It’s just a personal page, but still I get annoyed by the slow response of the first hit.
The main cause is obviously that nobody visits it. So Azure will unload the worker process that runs the website and reload it after it gets hit again. But little to no hits doesn’t mean I don’t want it to be fast for the first response. I need it to be really fast. If this is my only user today I need hoim

I’m running Azure from my MSDN subscription, so I actually have some money to spent. But I would rather spend it on other things than just my personal home page. The main reason I’m using Azure is to learn form it anyway. So I’m bummed out if the subscription is empty when I’ve got a new crary idea I want to try.

To fix this, I’ve come up with a way to keep my site ‘hot’ without the need to write any code. I have to admit, that I’m not yet sure what the overal cost of this solution would be. But the solution can be used for other purposed. So if you’re interested in turning some of you’re webpage or services into batch jobs. You should read on!

Always On

Azure provides you with a switch to keep the site ‘HOT’ at al times. The ‘Always On’ switch that you can find under the configuration of you’re site.

This is what it looks like on my site

AlwaysOn

So I need to pay to have a “hot” site? But don’t you guys know I’m dutch!

So how can we prevent Azure from unloading my site?

I could of course scale up to the basic plan and start paying. Since my site doesn’t really get any hits, it won’t cost much. But where is the fun in that!

Azure provides us with a plethora in tools. Most of them are free or cost very little. There has to be one that I could use.

First I looked at creating a webjob behind the site. It requirese me to write a script, this can be anything from node.js to powershell or even just a c# program. The idea would be to have it ping the website regularly. But I’d have to make something. And I’m a lazy son of a..

The easiest tool in you’re Azure toolbox is the Scheduler. You can simply tell it call any url on your site every (n) minutes.

The scheduler

In the manage.azure.com portal you can find the tab Scheduler just below CDN and Automation.

Scheduler

Here we’ll just create a new job. Click “New” in the lower left corner. You’ll have to choose Custom.

create-job

Now you’ll have to chose either an existing Job Collection or create a new one.
You can create Job Collection for different regions. If you use this by means of a ping, you’re site will be pinged from that specific region.
Let’s say we did pay for a scaled website, this could be userfull if we distributed multiple instances of the site over the entire world.
We would probably have the always on switch on.

You can use this for other purposes! One thing I came up with is using it to fetch a page or generic handler, that does an expensive data call and places the result in cache.
This will make you’re ‘cache update’ generichandler both an interface a user could call on demand and a batch job.

The other thing that could be userfull is fetching pages from different regions to collect statistics about you’re sites latency to users in that region.
This can be usefull when you need to deside if you want to deploy a copy of the site to that region.
You can use Application Insights for that. But I guess that will be a different blog.

job-collection

Next we’ll set up the job itself. We need to give it a name and choose which protocol and method we need to use. Remember that this can also be incredibly usefull for firing of something like a webservice, that copies rss feeds to a database, or whatever.

job-name

The next step in the wizard is the schedule. Here things get a bid odd. You have to choose an end date. The default is next month. You cannot make it run forever here. So just ignore it for now. We’ll fix this later.

job-schedule

So great. We’ve set up a job that will fetch the website every 10 minutes. This will prevent it form going idle. And it should make all the next responses snappy.

Fix the schedule

In the previous step we couldn’t choose for the job to run forever. This isn’t really a restriction of the job schedule. Just a restriction of the wizard. To fix this we’ll need to go to the job settings themselfs. You need to go into the job collection. And than to Jobs.

Open the right job and then under Schedule all the way down. Select ‘no end date’.

schedule-fix

Conclusion

The problem I’m trying to solve here might have a better solution. But if you’re site isn’t hit often (yet) because you’re a startup and you still need it to be fast for first use, this might be an option.
However choosing a pay-as-you go type subscription an switching the alway on switch might not cost as much on a low traffic site anyway.

What we did get out of it though is a simple overview of the Scheduler. And I think it can be used for simple batch type processing. And for instantiating cache results.
I’ve got a few scenario’s where there is a lengthy operations that caches it’s results. You could make a webjob for this, but then it might be harder to also make this possible on user demand.

Next to that, if you have now idea ho to make webjobs but you know how to create .aspx pages or generic handlers. All of a sudden you’ll get a batch processing system, without the need to learn anything new.

The unemployment job

I’m a developer. And it is my job to make software that will make other peoples jobs easier, so they can be more productive.

Is it really? Lately I’m more and more getting the feeling that it’s my job to eliminate jobs.

My own employer works for large companies, that employ hundreds of people. And as my star has risen I’m sitting in at more top level discussions with these customers. And these discussions don’t just deal with making jobs easier. They often deal with making jobs obsolete.

From a developer perspective, these are the best assignments. In “department a” 10 people do administrative tasks, how can we automate these tasks in such a way, that this can be done by just 1 person. But what happens to these 9 jobs?

It’s often said, that innovation will eliminate jobs in one area and create new jobs in another area. For most of our customers this is true. Their core business is not the administration of the business itself. So if they eliminate an FTE in administration, they will most likely ‘grow’ their business by hiring an FTE at a technical (core business) position.

If this not the case and the shrink in personel is needed to prevent the business from going belly up, than at least it has protected jobs.

But if we as developers elimate an adminstrative job in favour of a more specialist technical job, that means that we’ve created a person with the wrong market skill.

This was the fear of many in the Industrial Revolution. People even revolted agains the machines, but it turned out that eventhough the skilled handworkers were no longer needed, it created more jobs than where lost.

But I think there is a difference with the ICT innovation against the machine innovation of the Industrial Revolution. Actually there are 2 key points here.

The first is the type of job exchange. In the industrial revolution jobs went from high skill to low skill. So new jobs were created, that were accessible to less skilled people. Right now the opposite is true. Jobs are getting increasingly technical and requiring more and more skill.

The second is speed. The speed of the industrial revolution didn’t even come close to the speed of the current technical innovation speed.

A school education here in the netherlands will spew out a new potential worker at age 18 to 24 (depending on the level of eduction). 24 years ago, you did not own a mobile phone. There were no selfdriving cars. The internet was just a fad.

Countries like the netherlands are struggling to keep their education system moving along with the relentless pase of progress. The whole school system is still aimed at prepairing you for a specific job, while this job has changed by the time the education is over.

So what happens to these jobs that are ‘developed’ away? And what happens to the people that possed the skills to perform these jobs? Will they be able to learn something new?

I will give an example, that for me is close to home. The town I live in Meppel (Netherlands) used to profound for it’s graphical industry. There we’re huge companies that had huge printing presses. They employed thousands of people.

My father was one of them. He was a lithograph. When he started this was an analog process. Films, for the presses, were created much the same way photo’s were developed. An high skill job, that it must be said, took some time.

In the 90’s things changed. The scanner made it’s introduction. My father got a nice apple computer and developed photo’s where stuck on a scanner and this scanner together with software and a film printing machine, made the films. The innovation made my father more productive. His company could do more work in the same amount of time.

These scanners cost in more than a 100.000 euro’s (guldens at the time) and the other machines and computers needed were equally expensive.

Now you can buy a scanner for just 50 bucks that outperforms the scanners of the day. Next to that, scanners themselfs are obsolete, because of the introduction of digital photography.

My fathers job ceased to exist before he was 50 years old. Innovation made it obsolete in just 20 years.

The graphical industry in my town is gone. Most of the customers made shopping catologs and commercial folders, these are all websites now.

Of course new jobs have come in place. Like the webdevelopers and designers. But not al the people that used to work in the graphical industry made this switch. Most of them just went unemployed.

My father began a new career in painting peoples houses. But I guess in a way he was lucky to have another skill to fall back to.

So did the change from print to the web create more or an equal amount of jobs? I’d have to look at research to know. But what I do know is that even the job of web developer/designer isn’t going to be save. If you are a webdeveloper, take a look a this; https://thegrid.io/. And of course you are a better designer. But think of all you’re mediocre collegeas. Are they better designers?

I must say I see beautifully designed websites, made by very skilled people. But be honest. 90% of the web is just spawn from a template. And most webdevelopers/designers will use the same template to satisfy 90% of their customers. And the only reason for the business to be so big is that the target audience consists of 50 year old entrepreneurs. The new generation of entrepreneurs grew up with computers and knows how to install wordpress with an acceptable template.

And for most small businesses something that https://thegrid.io/ can create will be fine.

But most certainly I as a developer should be in the clear right? We’ll need developers forever to drive the innovations? I’m not so sure. As a developer I am used to a live of continuous learing, but we all know that with age this become harder. And 10 years from thing might look completely different.

Machine learing, software that creates better software. It’s all here now. It’s not a distant dream, this is happening right now. For the type of business backoffice software I create you see the trend of model based software factories, that put the creation of software in the hands of the business consultant.

I like to think I’m a good developer, but I’m not the one creating the machine learing software itself. And I’m just not going to be able to venture out into such a field. I’ll have admit to that.

So how long untill some developer, a lot smarter than me, will make my job obsolete?

And more importantly, will I be able to adapt?