Resume backup of a azure VM, Powershell command - azure

I just disabled the backup of my Azure VM and moved it to another subscriptions with all dependencies. Now I want to resume the backup using Powershell command. But I find that there is only some command for enable or disable backup, is there anything to resume a backup ?

If you want to resume ? Just Re-enable vm backup?
Reference: Enable backup for an Azure VM and Back up a virtual machine in Azure with PowerShell
You enable backup for an Azure VM, and specify a backup policy.
The policy defines when backups run, and how long recovery points created by the backups should be retained.
The default protection policy runs a backup once a day for the VM, and retains the created recovery points for 30 days. You can use this default policy to quickly protect your VM.
Enable backup as follows:
First, set the default policy with Get-AzRecoveryServicesBackupProtectionPolicy:
$policy = Get-AzRecoveryServicesBackupProtectionPolicy -Name "DefaultPolicy"
Enable VM backup with Enable-AzRecoveryServicesBackupProtection. Specify the policy, the resource group and the VM name.
Enable-AzRecoveryServicesBackupProtection `
-ResourceGroupName "myResourceGroup" `
-Name "myVM" `
-Policy $policy

As you know there is enable or disable operation for Azure VM backup. I think there is no such resume backup operation. Per my understanding, I suppose what you want is to continue backups the Azure VM in the existing recovery service vault after you move the Azure VM to another subscription. If so, please note that
Recovery Services vault doesn't support cross subscription backups. If
you move a vault with virtual machine backup data across
subscriptions, you must move your virtual machines to the same
subscription, and use the same target resource group to continue
backups.
To move a virtual machine to a new subscription without moving the Recovery Services vault:
Temporarily stop backup
Delete the restore point. This operation deletes only the instant recovery points, not the backed-up data in the vault.
Move the virtual machines to the new subscription
Reprotect it under a new vault in that subscription
In this case, you have to create a new vault for Azure VM backup after you move the VM to another subscription, so you will use Enable-AzRecoveryServicesBackupProtection to enable backup for an Azure VM then start a backup job with Backup-AzRecoveryServicesBackupItem.
Otherwise, you can move a Recovery Services vault and its associated resources to another subscription. Currently, you can move one Recovery Services vault, per region, at a time. You can't move vaults that back up Azure Files, Azure File Sync, or SQL in IaaS virtual machines. To move a Recovery Services vault, you must enroll in a limited public preview.
You also could get more details from the recovery service limitation.

Related

AZURE Restoring backup from resource that changed resource group

Scenario:
I had the need to move resources from one vault to another, without deleting the backups. This was due to cost, as the vault was created and everything protected in GRS, instead of LRS. I stopped all the backups in the GRS vault, moved everything from resource group (workaround that I found) and then I was able to protect everything in the new Vault. As I moved from resource group, the VM's changed their ID, and now I need to restore a backup that was in the old vault, but the restore fails because it's not able to find the VM.
Is there any way to do it?

Azure VM backup/automation not working after restore

After the VM was restored (whole VM not disk), the backup stopped working in Recovery Service Vault. Also the Azure automation account that used to shutdown the VM, stopped working. How to fix it such that all restored VMs continues to work as the previous one?
Kindly note that if you restored a VM to the same resource group with the same name as the originally backed-up VM, backup continues on the VM after restore, else if you restored the VM to a different resource group or you specified a different name for the restored VM, you need to set up backup for the restored VM.

Receiving an Error when deleting an Azure Recovery Services Vault

I have an old Azure Recovery Services vault for an on-premise Windows Desktop that I am trying to remove after decommissioning said desktop. Azure is responding with this error message:
Vault cannot be deleted as there are existing resources within the vault. Please ensure there are no backup items, protected servers or backup management servers associated with this vault. Unregister the following containers associated with this vault before proceeding for deletion : VAULT-NAME. Unregister all containers from the vault and then retry to delete vault
Where VAULT-NAME is the name of my vault.
I followed the steps referenced in this answer but could not get past this step due to the fact that there is not a corresponding "Windows" or "WindowsServer" option for the WorkloadType parameter.
$item = Get-AzureRmRecoveryServicesBackupItem -Container $container -WorkloadType AzureSQLDatabase
Skipping the item retrieval and disable steps and instead trying to unregister the container and remove the vault with the following commands was of no use on account of still having backups associated with the container.
Unregister-AzureRmRecoveryServicesBackupContainer -Container $container
Remove-AzureRmRecoveryServicesVault -Vault $vault
I have not mapped this answer to the corresponding Azure commands, but I was able to find my way to a solution via the Azure Portal. The steps were as follows:
Selected my Recovery Service resource
Under the Manage section, clicked Backup Infrastructure
Under Management Servers, clicked Protected Servers
In the list that followed, clicked on the row where my Protected Server Count was greater than 0, in my case, Azure Backup Agent (because the backup agent was installed on my Windows Desktop)
Clicked on my server name in the Protected Server list
Clicked Delete in the card for my protected server
After that completed, I was able to delete the entire vault. These steps may be helpful if you have other Backup Infrastructure resources and possibly even Site Recovery Infrastructure resources associated with a vault.
Update: It seems like there's an open issue for Get-AzureRmRecoveryServicesBackupItem not having any capacity to return MARS backup items which is ultimately what the issue here was.

TFS 2015 and Azure VMs File Copy

In TFS I selected Azure VMs File Copy:
My machine is classic and I created classic storage account. I set up the connection using username and password, not management certificate.
The storage account and cloud service I had to populate myself, because they did not appear in the drop-down menu (so possibly something is wrong already at this stage).
In the Cloud Service I entered MyMachine.cloudapp.net.
The task starts, it seems to login successfully, but throws:
Unable to find type [Hyak.Common.CloudException]
Log:
2017-11-24T14:21:28.80333Z Add-AzureAccount -Credential $psCredential
2017-11-24T14:21:35.866333Z Select-AzureSubscription -SubscriptionId -Default
2017-11-24T14:21:35.882333Z Set-AzureSubscription -SubscriptionId yy -CurrentStorageAccountName yyy
2017-11-24T14:21:35.898333Z ##[debug]Starting Azure File Copy Task
2017-11-24T14:21:35.898333Z ##[debug]connectedServiceNameSelector = ConnectedServiceName
2017-11-24T14:21:35.898333Z [debug]connectedServiceName = yyyyyy
(..)
2017-11-24T14:21:35.991333Z ##[debug]Loading AzureUtilityLTE9.8.ps1
2017-11-24T14:21:36.007333Z ##[debug]Connection type used is
UsernamePassword
2017-11-24T14:21:36.022333Z ##[debug]Azure
CallRetrieving storage key for the storage account:
mystorageaccount
2017-11-24T14:21:38.924333Z ##[error]Unable to find type
[Hyak.Common.CloudException].
Please help.
Actually you don't need to manually type the storage account, it will auto appear in the drop list. You just need to specify a pre-existing classic storage account. It is also used as an intermediary for copying files to Azure VMs.
Classic Storage Account
Required if you select Azure Classic for the Azure Connection Type
parameter. The name of an existing storage account within the Azure
subscription.
According to your log, the issue may related to the storage account setting. Double check this configuration under your Azure subscription.
Also suggest you go through this documentation to get more info of the Azure File Copy task. Such as make sure the machine should configured to allow WinRM connections.

Can we recover the azure resource group in azure cloud?

Some times we had deleted the 'resource group' accidentally on azure cloud, its fine that if our/your resource group does not have any deployments on it and we can create immediately newer one and will proceed our stuff, but if we had deployments on it, then its becomes major problem/task.
So can we recover Resource Group? like a recovery of Virtual machine in Azure.
You can export service configurations that belong to a resource group as JSON. Within the portal, there is an option "Export Template" under the Resource Management Navigation Group.
So can we recover Resource Group? like a recovery of Virtual machine in Azure.
Unfortunately, we have no way to recovery it, if the resource group is deleted . We could get the warning if we try to delete resource group from the azure portal. Connect to Azure support team for help maybe a way, but I don't think it could be easy for restoring.
Note : based on my understanding even if we could re-create the resource with ARM template(If we have exported the ARM template before delete), it seems that just with the same resource names with deleted resource that is not equal recovery action.

Resources