powershell - Windows Azure Virtual Machine with Startup Task -
is there way add (parametrized) startup task windows azure virtual machine through api? need execute cmdlet after machine has been started , code depends on 2 parameters different each machine. know achieved web/worker role, done virtual machines, well?
no. there no such feature provided out of box.
however, given deal vm anyway, can create image of own. can register "startup task" in runonce registry key. , sysprep os settings.
this way have startup task executed when machine boots first time , not executed on consequent vm restarts.
taking parameters code vm not easy web/worker role. want have query azure management api directly. properties can code running on azure vm normal os properties - i.e. host name, host ip address. don't know cloud service name, nor virtual ip address (this can discovered via services whatismyip.net or similar). approach put parameters azure table storage , use machine name rowkey. can store vm specific values based on vm name. , "startup" task query table storage, providing host name rowkey (and common pattern partition key), gets required settings.
Comments
Post a Comment