Scheduling startup (booting) of a Azure VM - azure

I have a Windows based VM on Azure Cloud. Using the Portal on portal.azure.com I can start/stop the machine.
Is there a way to create a schedule in Azure so that the VM is started (booting) on a specific date/time / schedule? So that the VM's state is changed from Stopped (deallocated) to Running when it is scheduled to do so?

You can schedule any operations with Azure Automation.
This article describes how to run Azure VMs during office hours.

Related

Do my azure account permissions affect my Virtual Machine operation

I have a Virtual Machine in azure that is set to boot up daily, run some scripts via cron, and then shut down.
A week ago my colleague changed my took away my co-adminstrator role within Azure. Since then the scripts have failed to run. I don't even know if the VM has been booting up.
How does the role/permissions associated with my account affect the behaviour of a VM that I have created?
EDIT
I suspect the point of failure is the Automation Task that starts the VM each day.
How does the role/permissions associated with my account affect the
behaviour of a VM that I have created?
To run the automation tasks in a VM, the account which used to authenticate the VM should have the proper role/permissions.
As you are no longer the co-administrator of that Azure Subscription, you should have a proper role to run the automation tasks in a VM with your account.
For example, with the contributor role, you can create and run the automation tasks in your Azure VM

Start azure virtual machine without azure portal

I want to give access to somebody to a virtual machine on Azure (with the RDP connection file) and let him start/stop the VM but without giving him access to the Azure Portal account.
Is there a (simple) way to start/stop virtual machine on Azure without having to access the portal ? By "simple" I mean something that you don't need to run some line code and that can be as easy as opening a RDP file.
Alternatively, is there a way not to be billed of a running (but idle) virtual machine ?
You can use a Powershell script to start/stop the VM.
No you will be billed for the stopped VMs also as long as you have checked them out.
For your requirement, I think the best way is to use the Service principal with the role of Virtual Machine Contributor. It just lets the user manage the VM, but without access to the VM and also do not have the permission to access the Azure portal.
Then you can use this service principal to execute the Azure CLI, Azure PowerShell commands or the REST API to start/stop the Azure VM, it does not cost.
Is there a (simple) way to start/stop virtual machine on Azure without having to access the portal ? By "simple" I mean something that you don't need to run some line code and that can be as easy as opening a RDP file.
There are SDK's available which you can use along with CLI to have programmatic access to the VM - in this manner, you do not require access to the portal.
Alternatively, is there a way not to be billed of running (but idle) virtual machine?
You will be billed for idle VM as this still means that VM is operational. To save costs, terminate the VM and create the VM again when required.

MS Azure: VM auto start/shutdown

Is there any way in which I can automate stopping my VM on a Friday and starting this back up again on the Sunday evening at specified times?
I’m aware this is possible via the VM blade and DevTest labs but their only option is daily, whereas I want this only shut down in the weekends.
Any input will be greatly appreciated. Thanks
Given that you need more precise control over scheduling than is possible in the Azure VM Auto-Shutdown blade or Azure Dev-Test Labs, you can accomplish startup / shutdown on specific days via RunBooks in an Azure Automation Resource.
Create (or choose an existing) Azure Automation Account resource
In the new Automation resource, go to the Runbooks blade
Click "Browse Gallery"
Search for and import "Stop Azure V2 VMs" and "Start Azure V2 VMs" runbooks
Schedule the new runbooks to run as needed
This walkthrough shows how to setup your runbooks with a specific schedule and parameters to target your virtual machine(s).
I would recomment to you, to read this:
http://azurecorner.com/start-stop-windows-azure-vms-according-time-schedule/

Azure shut down schedule

We have a client who runs Dynamics NAV infrastructure on Azure VM. I am about to configure a schedule in such a way,it matches office hours.
What will happen if service is used at shutdown time and other user interacting with the service running on VM. Is there a way to manage that?
Thank you.
I am about to configure a schedule in such a way,it matches office
hours.
You could use Azure runbook to schedule start or stop your VM, please refer to this blog.
What will happen if service is used at shutdown time and other user
interacting with the service running on VM.
If your VM shutdown, Dynamics NAV could not provide service. If your user need Dynamics NAS service, you need start your VM.

Metrics related powershell commands in azure

We're trying to get the cpu percentage,disk read throughput,etc programmatically using powershell commands for metrics in azure but we are not able to get any of the commands according to new release.
First of all are you trying to get performance details from Web/Worker Role or New preview release of Windows Azure Virtual Machines?
With Windows Azure Virtual Machine:
You have full access to your Azure VM and configure it the way you would do in any remote VM and the get the performance data out of it. With Windows Azure Virtual Machine if you want to get Performance data from Powershell you would need to do the following:
Configure to Azure VM to have PowerShell Remote Access
Configure Azure VM port settings so you can connect from on-premise machine (this is must and you should know that open port will open connection to VM outside)
Configure Azure VM to collect performance data
Connect from your on-premise machine using PowerShell and collect performance data
You can find several resources on Internet to do above task.
With Web/Worker Role:
Even when you are using new Powershell cmdlets with Windows Azure, older commands are still accessible and working as expected. To get Performance metrics from Azure Here are some resources for your to try:
Windows Azure Diagnostics and PowerShell – Performance Counters:
Part 1 | Part 2
How To Easily Enable Windows Azure
Diagnostics Remotely

Resources