0
votes

I'm using this URL to try to disable a scheduled backup job in Azure Recovery Services Vault :

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/DisableBackup?api-version=2016-06-01

Unfortunately, I get an error message like this :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>404 - File or directory not found.</title>

What syntax I need to use to disable my job ?

1

1 Answers

0
votes

In Azure portal, we could disable backup schedule by clicking Stop backup menu item.

enter image description here

After capture the traffic by IE development tool(opened by pressing F12), I found the request message should be following format.

Request URL:

POST https://main.recoveryservices.ext.azure.com/api//Subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.RecoveryServices/vaults/{recovery-services-vault-name}/backupFabrics/Azure/protectionContainers/IaasVMContainer;{containerName};{resource-group};{protected-item-name}/protectedItems/VM;{containerName};{resource-group};{protected-item-name}/DisableBackup

Request body:

{"virtualMachineId":"/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Compute/virtualMachines/{VM-name}"}

I suggest you capture the traffic by yourself and use the request message as REST request.