diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj
index 9622179da9e2..2c06fabf8594 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj
@@ -41,7 +41,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.1-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.dll
+ ..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.2-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.dll
False
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupContainerTests.ps1 b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupContainerTests.ps1
index 466e97accd08..2b500adf8f45 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupContainerTests.ps1
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/ScenarioTests/AzureBackupContainerTests.ps1
@@ -42,6 +42,8 @@ function Test-AzureBackupMarsContainerScenario
Assert-AreEqual $container.ResourceName $vault.Name;
Assert-AreEqual $container.Status $ContainerStatus;
+ Enable-AzureBackupContainerReregistration -Container $container
+
Unregister-AzureBackupContainer -Container $container -Force
$unregContainers = Get-AzureBackupContainer -vault $vault -type $ContainerType -name $ContainerName
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/SessionRecords/Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests/AzureBackupMarsContainerScenarioTests.json b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/SessionRecords/Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests/AzureBackupMarsContainerScenarioTests.json
index 503061a5b70f..28eb048b07bd 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/SessionRecords/Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests/AzureBackupMarsContainerScenarioTests.json
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/SessionRecords/Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests/AzureBackupMarsContainerScenarioTests.json
@@ -10,13 +10,13 @@
"en-us"
],
"x-ms-client-request-id": [
- "3bde4861-d6c7-4785-b954-c2fb7498260c-2015-07-17 19:46:07Z-PS"
+ "c164ee99-024c-490f-909f-46fcbfce27e3-2015-07-22 12:42:18Z-PS"
],
"User-Agent": [
"Microsoft.Azure.Management.BackupServices.BackupVaultServicesManagementClient/1.0.0.0"
]
},
- "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"backuprn1\",\r\n \"etag\": \"327fe758-7f7b-4879-b708-4d5366d2c687\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"ProvisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn1\",\r\n \"type\": \"Microsoft.Backup/BackupVault\"\r\n}",
+ "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"backuprn1\",\r\n \"etag\": \"327fe758-7f7b-4879-b708-4d5366d2c687\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn1\",\r\n \"type\": \"Microsoft.Backup/BackupVault\"\r\n}",
"ResponseHeaders": {
"Content-Length": [
"339"
@@ -31,28 +31,28 @@
"no-cache"
],
"x-ms-request-id": [
- "650d6914-a58c-4610-90c4-578f43f4194a"
+ "499ed874-b244-4ac2-ae34-905b70f28b7a"
],
"x-ms-client-request-id": [
- "3bde4861-d6c7-4785-b954-c2fb7498260c-2015-07-17 19:46:07Z-PS"
+ "c164ee99-024c-490f-909f-46fcbfce27e3-2015-07-22 12:42:18Z-PS"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-ratelimit-remaining-subscription-reads": [
- "14995"
+ "14993"
],
"x-ms-correlation-request-id": [
- "650d6914-a58c-4610-90c4-578f43f4194a"
+ "499ed874-b244-4ac2-ae34-905b70f28b7a"
],
"x-ms-routing-request-id": [
- "CENTRALUS:20150717T194610Z:650d6914-a58c-4610-90c4-578f43f4194a"
+ "CENTRALUS:20150722T124220Z:499ed874-b244-4ac2-ae34-905b70f28b7a"
],
"Cache-Control": [
"no-cache"
],
"Date": [
- "Fri, 17 Jul 2015 19:46:10 GMT"
+ "Wed, 22 Jul 2015 12:42:19 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
@@ -70,7 +70,7 @@
"en-us"
],
"x-ms-client-request-id": [
- "3bde4861-d6c7-4785-b954-c2fb7498260c-2015-07-17 19:46:07Z-PS"
+ "c164ee99-024c-490f-909f-46fcbfce27e3-2015-07-22 12:42:18Z-PS"
],
"User-Agent": [
"Microsoft.Azure.Management.BackupServices.BackupVaultServicesManagementClient/1.0.0.0"
@@ -91,29 +91,29 @@
"no-cache"
],
"x-ms-request-id": [
- "f28b0d83-8805-4900-92db-90809a187048"
+ "eab30911-4bd3-4732-8ca1-c5010a84dd8b"
],
"x-ms-client-request-id": [
- "3bde4861-d6c7-4785-b954-c2fb7498260c-2015-07-17 19:46:07Z-PS",
- "3bde4861-d6c7-4785-b954-c2fb7498260c-2015-07-17 19:46:07Z-PS"
+ "c164ee99-024c-490f-909f-46fcbfce27e3-2015-07-22 12:42:18Z-PS",
+ "c164ee99-024c-490f-909f-46fcbfce27e3-2015-07-22 12:42:18Z-PS"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-ratelimit-remaining-subscription-reads": [
- "14994"
+ "14992"
],
"x-ms-correlation-request-id": [
- "f28b0d83-8805-4900-92db-90809a187048"
+ "eab30911-4bd3-4732-8ca1-c5010a84dd8b"
],
"x-ms-routing-request-id": [
- "CENTRALUS:20150717T194611Z:f28b0d83-8805-4900-92db-90809a187048"
+ "CENTRALUS:20150722T124221Z:eab30911-4bd3-4732-8ca1-c5010a84dd8b"
],
"Cache-Control": [
"no-cache"
],
"Date": [
- "Fri, 17 Jul 2015 19:46:11 GMT"
+ "Wed, 22 Jul 2015 12:42:21 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
@@ -134,10 +134,10 @@
"Microsoft.Azure.Management.BackupServices.BackupVaultServicesManagementClient/1.0.0.0"
]
},
- "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"uniqueName\": \"dpmdrscaleint1.dpmdom02.selfhost.corp.microsoft.com\",\r\n \"containerType\": \"Machine\",\r\n \"properties\": {\r\n \"containerId\": 10034,\r\n \"friendlyName\": \"DPMDRSCALEINT1.DPMDOM02.SELFHOST.CORP.MICROSOFT.COM\",\r\n \"containerStampId\": \"eaf33dbc-a5b5-411a-a6af-1976a3f94602\",\r\n \"containerStampUri\": \"https://sea-dev01-prot-4bodw.ext.trafficmanager.net\",\r\n \"canReRegister\": false,\r\n \"customerType\": \"OBS\"\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}",
+ "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"uniqueName\": \"dpmdrscaleint1.dpmdom02.selfhost.corp.microsoft.com\",\r\n \"containerType\": \"Machine\",\r\n \"properties\": {\r\n \"containerId\": 10034,\r\n \"friendlyName\": \"DPMDRSCALEINT1.DPMDOM02.SELFHOST.CORP.MICROSOFT.COM\",\r\n \"containerStampId\": \"eaf33dbc-a5b5-411a-a6af-1976a3f94602\",\r\n \"containerStampUri\": \"https://sea-dev01-prot-4bodw.ext.trafficmanager.net\",\r\n \"canReRegister\": true,\r\n \"customerType\": \"OBS\"\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}",
"ResponseHeaders": {
"Content-Length": [
- "401"
+ "400"
],
"Content-Type": [
"application/json"
@@ -149,29 +149,29 @@
"no-cache"
],
"x-ms-request-id": [
- "46a1fbfd-6e8b-4ab0-835b-1dcbe559162f"
+ "fa7caa14-ec77-4ba2-8ffd-e847c2666e0f"
],
"x-ms-client-request-id": [
- "012da3f2-c253-475c-9f1a-516b11d3a906",
- "012da3f2-c253-475c-9f1a-516b11d3a906"
+ "6ff22313-2e0b-4a95-b237-14f50997f221",
+ "6ff22313-2e0b-4a95-b237-14f50997f221"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-ratelimit-remaining-subscription-reads": [
- "14993"
+ "14991"
],
"x-ms-correlation-request-id": [
- "46a1fbfd-6e8b-4ab0-835b-1dcbe559162f"
+ "fa7caa14-ec77-4ba2-8ffd-e847c2666e0f"
],
"x-ms-routing-request-id": [
- "CENTRALUS:20150717T194612Z:46a1fbfd-6e8b-4ab0-835b-1dcbe559162f"
+ "CENTRALUS:20150722T124222Z:fa7caa14-ec77-4ba2-8ffd-e847c2666e0f"
],
"Cache-Control": [
"no-cache"
],
"Date": [
- "Fri, 17 Jul 2015 19:46:11 GMT"
+ "Wed, 22 Jul 2015 12:42:21 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
@@ -192,10 +192,10 @@
"Microsoft.Azure.Management.BackupServices.BackupVaultServicesManagementClient/1.0.0.0"
]
},
- "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"uniqueName\": \"dpmdrscaleint1.dpmdom02.selfhost.corp.microsoft.com\",\r\n \"containerType\": \"Machine\",\r\n \"properties\": {\r\n \"containerId\": 10034,\r\n \"friendlyName\": \"DPMDRSCALEINT1.DPMDOM02.SELFHOST.CORP.MICROSOFT.COM\",\r\n \"containerStampId\": \"eaf33dbc-a5b5-411a-a6af-1976a3f94602\",\r\n \"containerStampUri\": \"https://sea-dev01-prot-4bodw.ext.trafficmanager.net\",\r\n \"canReRegister\": false,\r\n \"customerType\": \"OBS\"\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}",
+ "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"uniqueName\": \"dpmdrscaleint1.dpmdom02.selfhost.corp.microsoft.com\",\r\n \"containerType\": \"Machine\",\r\n \"properties\": {\r\n \"containerId\": 10034,\r\n \"friendlyName\": \"DPMDRSCALEINT1.DPMDOM02.SELFHOST.CORP.MICROSOFT.COM\",\r\n \"containerStampId\": \"eaf33dbc-a5b5-411a-a6af-1976a3f94602\",\r\n \"containerStampUri\": \"https://sea-dev01-prot-4bodw.ext.trafficmanager.net\",\r\n \"canReRegister\": true,\r\n \"customerType\": \"OBS\"\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}",
"ResponseHeaders": {
"Content-Length": [
- "401"
+ "400"
],
"Content-Type": [
"application/json"
@@ -207,29 +207,29 @@
"no-cache"
],
"x-ms-request-id": [
- "95e616a7-bb6a-434b-876d-8dc9271a9375"
+ "5b3c8878-c9cf-46be-bdb3-19802eedb355"
],
"x-ms-client-request-id": [
- "add32202-8b85-48cd-bf42-76899a482387",
- "add32202-8b85-48cd-bf42-76899a482387"
+ "27052a7f-7819-4c9f-ba06-70a027ba899f",
+ "27052a7f-7819-4c9f-ba06-70a027ba899f"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-ratelimit-remaining-subscription-reads": [
- "14992"
+ "14990"
],
"x-ms-correlation-request-id": [
- "95e616a7-bb6a-434b-876d-8dc9271a9375"
+ "5b3c8878-c9cf-46be-bdb3-19802eedb355"
],
"x-ms-routing-request-id": [
- "CENTRALUS:20150717T194612Z:95e616a7-bb6a-434b-876d-8dc9271a9375"
+ "CENTRALUS:20150722T124223Z:5b3c8878-c9cf-46be-bdb3-19802eedb355"
],
"Cache-Control": [
"no-cache"
],
"Date": [
- "Fri, 17 Jul 2015 19:46:12 GMT"
+ "Wed, 22 Jul 2015 12:42:22 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
@@ -265,29 +265,29 @@
"no-cache"
],
"x-ms-request-id": [
- "ad8d0c5f-7388-48d1-8079-8cee7573cf09"
+ "d3d15b49-b29c-44da-9690-6cf8ae84bc26"
],
"x-ms-client-request-id": [
- "7af25c88-040a-4ce3-9728-8f94fe64d42f",
- "7af25c88-040a-4ce3-9728-8f94fe64d42f"
+ "fca52e4f-b2fc-4ac5-bfa2-18677f3f7f9c",
+ "fca52e4f-b2fc-4ac5-bfa2-18677f3f7f9c"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-ratelimit-remaining-subscription-reads": [
- "14991"
+ "14989"
],
"x-ms-correlation-request-id": [
- "ad8d0c5f-7388-48d1-8079-8cee7573cf09"
+ "d3d15b49-b29c-44da-9690-6cf8ae84bc26"
],
"x-ms-routing-request-id": [
- "CENTRALUS:20150717T194618Z:ad8d0c5f-7388-48d1-8079-8cee7573cf09"
+ "CENTRALUS:20150722T124231Z:d3d15b49-b29c-44da-9690-6cf8ae84bc26"
],
"Cache-Control": [
"no-cache"
],
"Date": [
- "Fri, 17 Jul 2015 19:46:17 GMT"
+ "Wed, 22 Jul 2015 12:42:30 GMT"
],
"Server": [
"Microsoft-IIS/8.0"
@@ -295,6 +295,67 @@
},
"StatusCode": 200
},
+ {
+ "RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn1/backupContainers/10034/enableReRegister?api-version=2015-03-15",
+ "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3VwL0JhY2t1cFZhdWx0L2JhY2t1cHJuMS9iYWNrdXBDb250YWluZXJzLzEwMDM0L2VuYWJsZVJlUmVnaXN0ZXI/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==",
+ "RequestMethod": "PATCH",
+ "RequestBody": "{\r\n \"properties\": {\r\n \"enableReRegister\": true\r\n }\r\n}",
+ "RequestHeaders": {
+ "Content-Type": [
+ "application/json"
+ ],
+ "Content-Length": [
+ "58"
+ ],
+ "Accept-Language": [
+ "en-us"
+ ],
+ "x-ms-client-request-id": [
+ "d4147693-3a31-4b4c-ab4c-4714de4c47fe-2015-07-22 12:42:23Z-PS"
+ ],
+ "User-Agent": [
+ "Microsoft.Azure.Management.BackupServices.BackupVaultServicesManagementClient/1.0.0.0"
+ ]
+ },
+ "ResponseBody": "",
+ "ResponseHeaders": {
+ "Content-Length": [
+ "0"
+ ],
+ "Expires": [
+ "-1"
+ ],
+ "Pragma": [
+ "no-cache"
+ ],
+ "x-ms-request-id": [
+ "2c43793c-c4d7-4967-b315-b1e036aad163"
+ ],
+ "x-ms-client-request-id": [
+ "d4147693-3a31-4b4c-ab4c-4714de4c47fe-2015-07-22 12:42:23Z-PS",
+ "d4147693-3a31-4b4c-ab4c-4714de4c47fe-2015-07-22 12:42:23Z-PS"
+ ],
+ "Strict-Transport-Security": [
+ "max-age=31536000; includeSubDomains"
+ ],
+ "x-ms-ratelimit-remaining-subscription-writes": [
+ "1198"
+ ],
+ "x-ms-correlation-request-id": [
+ "2c43793c-c4d7-4967-b315-b1e036aad163"
+ ],
+ "x-ms-routing-request-id": [
+ "CENTRALUS:20150722T124224Z:2c43793c-c4d7-4967-b315-b1e036aad163"
+ ],
+ "Cache-Control": [
+ "no-cache"
+ ],
+ "Date": [
+ "Wed, 22 Jul 2015 12:42:24 GMT"
+ ]
+ },
+ "StatusCode": 204
+ },
{
"RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backup/BackupVault/backuprn1/backupContainers/10034/UnRegisterContainer?api-version=2015-03-15",
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3VwL0JhY2t1cFZhdWx0L2JhY2t1cHJuMS9iYWNrdXBDb250YWluZXJzLzEwMDM0L1VuUmVnaXN0ZXJDb250YWluZXI/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==",
@@ -305,7 +366,7 @@
"en-us"
],
"x-ms-client-request-id": [
- "3a02406f-4fc3-48b6-9621-c05d9d1c3cdb-2015-07-17 19:46:12Z-PS"
+ "a0308b26-2cf6-416c-b73c-3ad6dfcd825e-2015-07-22 12:42:25Z-PS"
],
"User-Agent": [
"Microsoft.Azure.Management.BackupServices.BackupVaultServicesManagementClient/1.0.0.0"
@@ -323,29 +384,29 @@
"no-cache"
],
"x-ms-request-id": [
- "3577d465-9453-43bc-93ec-93603396aa9f"
+ "029232e7-4fc9-4705-a0ab-d990cff5c3cb"
],
"x-ms-client-request-id": [
- "3a02406f-4fc3-48b6-9621-c05d9d1c3cdb-2015-07-17 19:46:12Z-PS",
- "3a02406f-4fc3-48b6-9621-c05d9d1c3cdb-2015-07-17 19:46:12Z-PS"
+ "a0308b26-2cf6-416c-b73c-3ad6dfcd825e-2015-07-22 12:42:25Z-PS",
+ "a0308b26-2cf6-416c-b73c-3ad6dfcd825e-2015-07-22 12:42:25Z-PS"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-ratelimit-remaining-subscription-writes": [
- "1199"
+ "1197"
],
"x-ms-correlation-request-id": [
- "3577d465-9453-43bc-93ec-93603396aa9f"
+ "029232e7-4fc9-4705-a0ab-d990cff5c3cb"
],
"x-ms-routing-request-id": [
- "CENTRALUS:20150717T194617Z:3577d465-9453-43bc-93ec-93603396aa9f"
+ "CENTRALUS:20150722T124230Z:029232e7-4fc9-4705-a0ab-d990cff5c3cb"
],
"Cache-Control": [
"no-cache"
],
"Date": [
- "Fri, 17 Jul 2015 19:46:17 GMT"
+ "Wed, 22 Jul 2015 12:42:30 GMT"
]
},
"StatusCode": 204
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/packages.config b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/packages.config
index 644017bb5681..4af04e15cc3e 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/packages.config
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/packages.config
@@ -4,7 +4,7 @@
-
+
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupClientAdapter/ContainerAdapter.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupClientAdapter/ContainerAdapter.cs
index 26376ea2dda3..b6cbc2eb44f7 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupClientAdapter/ContainerAdapter.cs
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/AzureBackupClientAdapter/ContainerAdapter.cs
@@ -63,5 +63,23 @@ public void UnregisterMachineContainer(long containerId)
{
AzureBackupVaultClient.Container.UnregisterMarsContainer(containerId.ToString(), GetCustomRequestHeaders());
}
+
+ ///
+ /// Enable container reregistration
+ ///
+ ///
+ ///
+ public void EnableMachineContainerReregistration(long containerId)
+ {
+ EnableReregistrationRequest request = new EnableReregistrationRequest()
+ {
+ ContainerReregistrationState = new ContainerReregistrationState()
+ {
+ EnableReregistration = true,
+ },
+ };
+
+ AzureBackupVaultClient.Container.EnableMarsContainerReregistration(containerId.ToString(), request, GetCustomRequestHeaders());
+ }
}
}
\ No newline at end of file
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/EnableAzureBackupContainerReregistration.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/EnableAzureBackupContainerReregistration.cs
new file mode 100644
index 000000000000..4ae62420fa63
--- /dev/null
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/EnableAzureBackupContainerReregistration.cs
@@ -0,0 +1,58 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+using System;
+using System.Web;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Linq;
+using System.Management.Automation;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Azure.Management.BackupServices.Models;
+using MBS = Microsoft.Azure.Management.BackupServices;
+using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
+using Microsoft.Azure.Commands.AzureBackup.Properties;
+using Microsoft.Azure.Commands.AzureBackup.Models;
+using Microsoft.Azure.Commands.AzureBackup.Helpers;
+using Microsoft.Azure.Management.BackupServices;
+
+namespace Microsoft.Azure.Commands.AzureBackup.Cmdlets
+{
+ ///
+ /// Enables reregistration of a machine container
+ ///
+ [Cmdlet(VerbsLifecycle.Enable, "AzureBackupContainerReregistration")]
+ public class EnableAzureBackupContainerReregistration : AzureBackupContainerCmdletBase
+ {
+ public override void ExecuteCmdlet()
+ {
+ ExecutionBlock(() =>
+ {
+ base.ExecuteCmdlet();
+
+ AzureBackupContainerType containerType = (AzureBackupContainerType)Enum.Parse(typeof(AzureBackupContainerType), Container.ContainerType);
+ switch (containerType)
+ {
+ case AzureBackupContainerType.Windows:
+ case AzureBackupContainerType.SCDPM:
+ AzureBackupClient.EnableMachineContainerReregistration(Container.Id);
+ break;
+ default:
+ throw new ArgumentException("Reregistration can be enable only for machine containers.");
+ }
+ });
+ }
+ }
+}
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj
index 9e4cbadcc414..bbab0c0d4663 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj
@@ -58,7 +58,7 @@
False
- ..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.1-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.dll
+ ..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.2-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.dll
..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
@@ -122,6 +122,7 @@
+
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Microsoft.Azure.Commands.AzureBackup.dll-help.xml b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Microsoft.Azure.Commands.AzureBackup.dll-help.xml
index 3308e22c0faa..453be5a0631b 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Microsoft.Azure.Commands.AzureBackup.dll-help.xml
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Microsoft.Azure.Commands.AzureBackup.dll-help.xml
@@ -1,4 +1,106 @@
+
+
+
+ Enable-AzureBackupContainerReregistration
+
+ Allow re-registration of the server to connect the server back to the vault and continue the backup points chain.
+
+
+
+
+ Enable
+ AzureBackupContainerReregistration
+
+
+
+ When a server is destroyed, all its cloud backup points remain in the Azure Backup vault. If the server is rebuilt and given the same FQDN, it is possible to connect it back to the same vault. This will allow the server to continue taking backups and adding new backup points to the existing set - essentially continuing where it was left off in the backup chain.
+ To make this connection, the AzureBackupContainer has to be primed for "re-registration". Without this step, you can lose all the existing data as a part of the registration process. The commandlet tells the service that the next time the container is registered, it should continue the backup chain.
+
+
+
+ Enable-AzureBackupContainerReregistration
+
+ Container
+
+ An object referencing the container for which re-registration is being requested
+
+ AzureBackupContainer
+
+
+ Profile
+
+ Non-mandatory AzureProfile input object
+
+ AzureProfile
+
+
+
+
+
+ Container
+
+ An object referencing the container for which re-registration is being requested
+
+ AzureBackupContainer
+
+ AzureBackupContainer
+
+
+
+
+
+ Profile
+
+ Non-mandatory AzureProfile input object
+
+ AzureProfile
+
+ AzureProfile
+
+
+
+
+
+
+
+
+ AzureBackupContainer
+
+
+
+
+
+ This section details out the type of the objects that you can pipe to the cmdlet.
+
+
+
+
+
+
+
+ None
+
+
+
+
+ This section details out the type of the objects that the cmdlet emits.
+
+
+
+
+
+
+
+
+ None
+
+
+
+
+
+
+
diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/packages.config b/src/ResourceManager/AzureBackup/Commands.AzureBackup/packages.config
index 8123d7359cfb..d36096ceeb5b 100644
--- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/packages.config
+++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/packages.config
@@ -4,7 +4,7 @@
-
+