Azure Automation Complex Schedule - azure

Is there a way we can specify a Complex Schedule for an Azure Automation Runbook?
Currently we can only configure if the Runbook needs to run Hourly,Daily,Weekly / Monthly. I want to set up something like "Run from Tuesday to Saturday, Daily at 1 PM".
Only way I can think of right now is to code it inside the RunBook.
Please let me know if there's any other way.
Thanks

Automation offers weekly and monthly schedules in the new Azure portal. This service announcement talks a bit about how you can use weekly/monthly schedules to do what you are looking for. You can also use the New-AzureRMAutomationSchedule cmdlet to create weekly schedules and specify the days (use the ByWeekly parameter set).

You have to write custom powershell script within your runbook and schedule your runbook to run every hour or probably everyday at 1PM.
The custom powershell script will have code which checks if a day is NOT Sunday, Monday and Saturday!

Related

Downgrading Azure Resources during weekends using PowerShell Automation

In order to save expenses in Azure DevOps, I'm trying to scale the resources, which can scale depending on the requirement. Team leads will update the resource requirements in SharePoint, and the runbook needs to be executed with SharePoint datat. Team leads will update the resource requirements in SharePoint, and the runbook needs to be executed with SharePoint data. If such resources are not required on weekends but must be operational on weekdays, they should be stopped or reduced in size. I need to use automation to do it for all of the VMs and App Services at a subscription level every Friday. If there is a method to automate this procedure using PowerShell.
I'm glad to receive input. Thanks in advance.
I'm looking for feedback on Start/Stop VMs and Scaling Azure App Services. On weekends, the same may be said for other relevant resources. How can we accomplish this with Azure PowerShell?
 
The best way to do is by using 'Azure Automation Runbook' scheduled to run every specified day or date by time. To target the VM's, Azure Tags will be much helpful.
Your script must check:
A VM has a specific Tags (e.g., StopVM:Friday 11:00PM)
Maintenance Enabled in your monitoring solution
VM is stopped already or not.
Backup required?
Confirm the VM is Deallocated (not stopped)
Auto-Shutdown option is also available to do this activity.
Because sometime all you need is a quick and dirty way to save money :
And if you wan't to build something there's an API to shutdown and start VMs

Azure - Dynamically get a schedule from database and trigger multiple methods to do different tasks in azure?

What is the best way of using Azure technology (azure function apps, durable function app, azure web jobs, ?) to get a schedule from a database depending on the specific task that needs to be performed.
The schedule that would be read from the database, would then be converted to a CRON expression. I have hourly, daily, and weekly triggers to run specific tasks.
The schedule within the database could possibly change, hence why it would need to be dynamic.
I could create individual specific function apps (over 20) but wanting it to be more flexible and dynamic.
How would i go about this? what azure tech would i use?
Thanks
Two options I can think of, depending on the details of what you're after:
Use timer-triggered Azure Functions with the %appsetting% format for the timer expression. Then have a separate function that's timed to run regularly or triggered when the schedules update, get the current schedule and update the function app settings with any changes to the CRON expressions (using a managed identity that gives it the necessary permissions).
If you're just running on the hour/day/week, you could have a function that runs every hour, reads the current schedule and triggers any functions that are scheduled for that time (basically your own simple timer).

How to schedule runbook based on minutes in Azure automation Account

How to schedule automatically execute runbooks based on minutes instead of hours in Microsoft azure automation account?
hm, I thought this was possible, but it appears not. you can create multiple hourly schedules for this (if you want it to start every 10 minutes - create 6 hourly schedules), you can create an azure function timer triggered and just start your runbook with that (more hacky, I guess) or create an external event that would start the runbook using the Azure API or, perhaps, via a webhook

Azure automation Schedule timezone

Can anyone guide me on which time zone is used when we create schedules for Azure Automation runbooks. Is it UTC and do we need to keep that in mind when creating the schedules for the runbooks
Thanks
Azure Automation schedules now have time zone support so that you can choose the time zone you want the schedule to run on. However, the schedule defaults to your local time zone.

Azure Scheduled VM

This is essentially a question about saving money - we have build machines in azure - but they are only active for about 8 hours a day. Is there any easy way to create a schedule, so they are taken off line for the rest of the time, so we only pay for 1/3 the amount of compute time?
Darren
Yes , its possible. There are two options available
Via Powershell
http://gallery.technet.microsoft.com/scriptcenter/Start-Windows-Azure-b6c179b6
Using Azure VM As scheduler.
http://clemmblog.azurewebsites.net/start-stop-windows-azure-vms-according-time-schedule/
The thing that you can do is using a Powershell script to start/stop the VMs at certain times.
You can find a draft at the Azure Management Portal, under Automation ==> Runbooks.
There you can also find runbooks to scale your machines over the night, to cut costs ever more.
I hope this helps :)

Resources