How to automate Azure Site Recovery failover? - azure

I have started exploring Azure Site Recovery with VMware as a disaster recovery solution for our customers. The main doubt I have is on how to automate failovers. I.e. how can I tell Azure to check if an on-prem VM is offline and automatically initiate the failover process? Do I need something like OMS to make it happen or should Automation runbooks or something similar be enough?

OMS does not have the solution to automate. But, automation runbooks like you guessed are supported by ASR. However you cannot use automation for individual VM's per se. You can use automation on recovery plans and have one VM as part of that plan.
This should give you some insight.
[1]: https://azure.microsoft.com/en-us/documentation/articles/site-recovery-runbook-automation/

Related

How to auto scale web apps vertically

I can see in Azure portal there is a nice UI to scale instances automatically.
Is there a way to change an app plan automatically?
For example, I may want to move from P1V2 to S1 during out of business hours, then scale back up again in the morning.
If there is no way to do it via the portal, I'm open to using APIs to change the app plans via a schedule functions or logic app if anyone can provide an example.
Any other suggestions are also welcome.
Thanks.
Is there a way to change an app plan automatically?
Not like there is a way to do so horizontally by using auto-scale. You can, however, accomplish this using Azure Automation.
Azure Automation delivers a cloud-based automation, operating system updates, and configuration service that supports consistent management across your Azure and non-Azure environments. It includes process automation, configuration management, update management, shared capabilities, and heterogeneous features.
Your scenario is explicitly mentioned under Common scenarios.
Azure resource lifecycle management - for IaaS and PaaS services.
Resource provisioning and deprovisioning.
Add correct tags, locks, NSGs, UDRs per business rules.
Resource group creation, deletion & update.
Start container group.
Register DNS record.
Encrypt Virtual machines.
Configure disk (disk snapshot, delete old snapshots).
Subscription management.
Start-stop resources to save cost.
Dev/test automation scenarios - Start and stop resources, scale resources, etc.
To set the App Service Plan, use Set-AzAppServicePlan from the Az.Websites module.

How to Auto Shut Down Azure Classic VM?

We are using an Azure Classic Virtual Machine!! It does not show 'AutoShutDown' Blade. Is this feature not available for Classic VM? When I searched, there is also an option to use Runbook in Automation Account to do this. Is anyone used this with classic VM?
This feature is not available with classic vms. its 2019, you should migrate to ARM anyway. but you could use custom powershell runbook to shutdown classic vms using a schedule.
you'd need to tag the resource groups (cant tag classic resources) and invoke the runbook hourly. this would be a nice starting point. in fact it does what you ask for.

How to add a vm to multiple azure automation hybrid worker group

We have one azure vm (jump server) which is already part of our staging hybrid worker group.
Now I want to add it to our prod hybrid worker group which is in different azure subscription. Is there any way to keep both?
Thanks in advance.
Currently in Azure Automation, A hybrid worker can only point to one automation account. There's already a request to the Azure Automation team to support this scenario. I recommend you Upvote the feedback # https://feedback.azure.com/forums/246290-automation/suggestions/33608410-utilize-the-same-automation-hybrid-runbook-workers

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/

In Azure, is it possible to move an existing set of hosted sites to another subscription?

On Azure, I am currently using my "3-month Free Trial" subscription, and just recently I got access to a "Windows Azure MSDN - Visual Studio Ultimate" subscription.
Is it possible to move an existing set of hosted sites to another subscription using the Portal?
Obviously I could just re-publish the sites using Visual Studio, but I'm wondering if there is a way to do this in the GUI?
There is no way you can accomplish in the Portal interface. You do have an option to request Windows Azure Billing Team and request them move all of your currently configured and running services from one Subscription to other subscription, the key is "all".
IF you want to move one specific service from one subscription to another then the available option is to deploy directly to other subscription.
I did do this once. I had to contact their billing team and after a couple of days of back and forth between them it was taking too long so I just did it manually, redeploying the sites to the new subscription. This may not be possible if you have many sites. I did a backup and restore of the SQL Azure database.
I am battling with azure support right now on trying to do the same thing. From what I can tell your best bet is creating the services on your MSDN subscription and redeploying.
I don't know a way to do this from the portal but I do recommend using Windows Azure PowerShell which has the ability to manage multiple subscriptions and in your case you can just do this cmdlet to copy a service into another subscription:
Publish-AzureServiceProject -sn MyNewSubscriptionName

Resources