Run application at VM start up in VMSS - azure-vm-scale-set

I want to run an application when each VM starts up in a VMSS.
What I did is as follows:
Create an VM.
Put my application under C driver
Use Windows Scheduler to let it run during the windows start up (no need to logon) and it works.
Capture the image according:
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/classic/capture-image
Use ARM template to create VMSS based on the image I captured
I cannot remotely desktop to the VM of VMSS, so I cannot check if my application runs. The application will call a web API when it runs. I found the API is not called so I guess my application did not run.
Does any know the reason?

Related

Enable windows service to use command line

I have written a simple service which is now active on my windows services. My problem is that I cannot access the cmd through the windows services. I am using nodejs express for my service, node-cmd for the cmd access & node-windows to create the service. My app does this:
app.get('/check', (req, res) => {
cmd.run('start chrome');
res.status(200).send('The server is working correctly :)');
});
For those of you that don't understand this, it basically means:
Listen for the GET '.../check' call, then do:
cmd: start chrome
return response 'The server is working correctly :)'
When I run this manually, then it starts chrome. When I use it as a windows services, then it doesn't start chrome but it DOES resond with The server is working correctly :)
For some reason, cmd command are not working in windows services?
From Windows Vista service processes run in a different session/desktop that user processes run (there is Microsoft white paper).
So, if you start chrome.exe from a service, it will be run inside the service session and will not be visible in the user's desktop. You can check the task list to ensure it has been started.

Run “WebSphere application server” and “WebSphere Process Server” in a single machine

In our project we have installed both the “WebSphere application server” and “WebSphere Process Server” in a single machine. But we are unable to run both the server at a same time.
WebSphere Process Server is mounted on top of WebSphere Application Server, so while we are running the process server the default WebSphere application server instance is starting with the process server. So after that if we try to start the separately installed WebSphere application server, we are getting error that one instance is already running. Please suggest how to avoid this conflict and run both the process and application server in the single machine?
Both are using the same port. We already renamed the server name of the separately installed WebSphere application server with “server2” and Process Server’s application server name is “server1”
Please share your suggestions
You need to create separate profile. You don't have to install WAS first, or install it again, if you don't want. You may use Profile Management Tool from your installation to create new separate profile for WAS (choose Application Server profile type, not Process Server).
If you want complete separation e.g different versions (like vX of WPS and vY of WAS), or different fix pack level, you will need to do full separate WAS install.
Websphere Process Server extends Websphere Application Server (WAS), so you should install WAS first. Websphere Process Server (WPS) install should be made on top. When installation is complete you will be able to create WAS and WPS profiles on this machine. WPS profile always include WAS libraries and can be managed exactly the same way as WAS.
If you want separate servers, you should create two profiles, one for WAS and one for WPS.
You will be able to manage them separately.

Run Web application as Specific user

On my application server machine ,I have done drive mapping using specific user.
But with web application running on Tomcat I am not able to access this drive because tomcat runs as a windows service and not with user which has the actual access to drive mapped.
So i want know how to run web application on tomcat server with specific user.
Run Tomcat as a Windows Service ( http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html ) and make sure that you set the user to run the service as isn't the standard SERVICE user or whatever.

how do i run appliaction as service in windows

i created a ruby application and its working fine but when i run it as service it giving trouble. actully i have mysql as a databse in my application and i am using it to store only name of the file and placing the physical file on sambha server now when i run my applioaction as as service it's not able to find the path of sambha server... any hlep...
What user account is running the service? Windows defaults to using the local SYSTEM account, which cannot/should not access the network. If you change the service to run under the "Network Service" or a specific user account, it may succeed.

How can I get my Windows Service to display in the system tray?

I have a Windows Service that runs in the background when the PC starts. I want to display an Icon on the system tray to allow configuration after a user has logged in but can't find how to do this.
Is there an event I should be looking for which tells me that a user has logged in?
As I understand Windows Services can't have a UI so do I need to start an app to display the sys tray icon? How can I pass configuration updates to my service.
You will want a seperate "agent" application for this. A Windows service is global, running at the system level. There can be multiple desktops running on the system at once, so while there are ways of allowing services to interact with the desktop layer, it is far from trivial to interact with the "users desktop" in the same manner that you do with an application already bound to a specific login/desktop environment.
There are also security risks involved with having a service tunnel into the desktop environment (it opens up a pathway to a system account unless the service runs on a more restricted one), which is why interacting with the desktop is disabled by default.
You will need a separate application to show the tray icon. You can communicate with your service either through WCF letting the service host a WCF service or through ServiceController.
I would create a second application that runs and displays itself in the system tray when the user logs in.
You can open remoting to the windows service, and pass the configuration updates through exposed methods from the app in the system tray.
Actually, I don't think you CAN show a service in the system tray. Applications doing this are always using an agent or other mangement tool.
Most of the time the application running in the tray is a very small app giving access to the settings for the service.
Configuration options could be stored in the registry, ini file or anyother storage option. After the configuration changes, all you need to do is make sure you restart your service, so it can reload it's new settings.

Resources