Update-AzureRmVmss command hanging and does not work when try to install custom script extension - azure

I'm trying about three days to run and get result from Update-AzureRmVmss command using powershell. However after lasting 20-30 minutes of waiting, it ends with offering reconnect or quit pop-up window. Is it related with azure infrastructure? Can not azure update vmScaleSet faster?
I need to from time to time update custom script extension and apply changes to virtual machines.
Any help would be appreciated.

Solved!
The problem was in my custom script extension. After downloading and running application there was -Wait command at the end of script. That was causing process to not finish

Related

Azure Batch Pool Stuck on Start Up Task

Hi everyone currently I am working on automating installation of certain application in one of our pool node in Azure Batch using application package.
For this example I am just trying to install google chrome in one our node but the node keeps getting stuck in waiting the startup task. The start up task is very simple as
cmd /c %AZ_BATCH_APP_PACKAGE_CHROME#95%\\ChromeSetup.exe -args -here
Please make certain that your installer is able to install in a non-interactive mode. For Google Chrome, this may help.
It turns out the it requires you to elevate the user access level to admin. It was not highlighted in documentation when using application package in batch account.
Just add this in your json config when deploying batch account node.

Python automation project to run in the background

i just started working with python and with some scripts to automate some tasks. I manage to create a web scraper using selenium that notifies me daily with the latest news via a mail . Now the script works great if i run it manually , but my question is : How can i make the script to run automatically every day , and what option would you recomand . I know that you can use TaskScheduler and program it , but i was wondering if you know any options to run it directly in the cloud ? Also , i found some tutorials where they say to wrap all the code in an infinite loop and add a timer , and once you run the script it will stay active as a background process,
I just started working with scripts and automation , so i would really like to know your opinion on the best way to run the script automatically . Thanks a lot
If this is on a unix-based OS, check out cron (this is a pretty good guide). You can schedule it to run your python script daily.
Im not sure if that is what you are looking for, but (if you are on windows) you could attach your program to your autostart. Probably your Startup Folder: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
If you schedule in your computer, i think it may not be proper solution. It's better to deploy it on any cloud platforms & schedule at any particular time.
I personally suggest Heroku, I'm using it for running multiple scripts for free. You can use scheduler addon for scheduling scripts to run at particular time as well. Please refer to heroku documentation & get started! Note: The script may run more time than you expected, please refer here to fix this.

Powershell scripts going to sleep

I have a powershell script which loops over each file in a folder and does a lot of "high-computation" tasks on each of these files. I have multiple instances of this script running on my system.
I do use a write-host before starting each of these tasks to see when these tasks start and end.
I started these instances of the script last night and when I came today morning I noticed that some of my powershell terminal were stuck at a write-host command and when I pressed ENTER they wrote that content to terminal and continued the preocessing.
It looks like some of these terminals go to sleep. Why am i seeing this and how can i prevent this?
Disable the "QuickEdit" option in the "Windows PowerShell" Properties window.
Right click the PowerShell window to get the to the Properties window.

Does virtual machine extensions provisioned for existing VM?

We have a VM ARM template which runs a custom extension when we provision it. This extensions run fine and install framework correctly.
By looking at verbose log it seems like it runs the extension every time we run deployment script even if VM is already present. Is this correct?
Also if it does run the extension every time, is there anyway to avoid it?
Basically every time the VM is rebooted or the same template is deployed again, the extension is run but only if the new configuration is different from the old one. It can rerun if the force rerun flag is set.
Hope this helps! :)

Powershell script not running on Task Scheduler

I have a PS script that opens Excel (Com Object), processes a bunch of information, re-saves, and then sends some critical information via e-mail. The script runs great, and when I run it from the Run Console, it works great as well. However, when I schedule it as a task in the Task Scheduler it is not working properly. The task seems to "successfully run" every single time, but I do not get the output e-mail that I am supposed to get. I have run many other PS Scripts without a problem using the same configuration in the task scheduler. Could this have something to do with opening Excel as part of a script scheduled? Any thoughts are welcome.
I solved this issue using the answer from #briantist in PowerShell script won't execute as a Windows scheduled task, but I wanted to isolate exactly which switch was solving the problem.
It had nothing to do with -ExecutionPolicy, -Noninteractive, -NoLogo, -NoProfile or any other system privilege, user account running the script, etc.
Just needed to add -File in front of the script path in the Task Scheduler > Actions > Arguments field. Without this switch PowerShell was launching and the task history was showing Action Completed, but the script was not executing.

Resources