Custom Hooks

Category: azure management


sol myr72 on Tue, 17 Dec 2013 06:24:54


We're considering Azure for our java webapplication, and were wondering whether it offers any hooks where we can add our legacy code (to integrate with legacy organizational infrastructure):

1) During deployment/undeployment of our webapp, can we hook our own code, to write some legacy audit message.

2) During deployment/undeployment of our webapp, can we hook our own code to change some property files inside the webapp

3) We'd like to run Tomcat with our old legacy javaagent. Would Azure place "sandbox" restrictions on our agent code (threads, connections)

Thanks very much


Will Shao on Wed, 18 Dec 2013 05:25:21

Hi sol,

Thanks for posting!

What is meaning about "hook"? Do you want to use version control?

We can use Java to develop azure project. We need install Azure SDK in our work round firstly ( ). And on my experience, we could update our project, we could re-deployment using java or update package on azure portal. If you use azure SDK, it may didn't affect your own logic code and any function. You could control version in your java project. I suggest you could refer to some tutorial such as :

If I misunderstand, please let me know.



sol myr72 on Thu, 26 Dec 2013 07:23:14

Thanks very much for replying.

The question is, can I ask Azure to run my own custom code, every time my application is deployed.

For example, say I deploy my application to Azure (using the great link you provided . At this point I'd like Azure to automatically send some message to my company's legacy Audit service. Can this be done? 

Thanks again

Yossi Dahan on Thu, 26 Dec 2013 08:41:09

I guess it depends on what granularity you need. I don't believe you get very detailed such 'hooks' but you do get a couple of things -

As part of your deployment package, in the service definition file you can configure start up tasks

These are scripts that can be run in elevator mode if needed and perform pretty much anything you want.

If you had a command line utility that knew how to send the message to the audit service you would hook it in here and get a notification when the role is being deployed.

Similarly a role class inherits from RoleEntryPoint which has an OnStart method which is called when your role is being initialised and you can plug some code here (this will need to be in .net though)

You can read about these here

So - not overly granular - but you get a couple of points.

I hope this helps