Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable-AzureRmRecoveryServicesBackupProtection does not respect -ErrorAction SilentlyContinue #3164

Closed
spaelling opened this issue Nov 2, 2016 · 3 comments
Assignees
Labels
Recovery Services Backup Service Attention This issue is responsible by Azure service team.

Comments

@spaelling
Copy link

spaelling commented Nov 2, 2016

Cmdlet(s)

Enable-AzureRmRecoveryServicesBackupProtection

PowerShell Version

5.1.14393.206

Module Version

2.2.0

OS Version

10.0.14393.206

Description

Enable-AzureRmRecoveryServicesBackupProtection does not respect -ErrorAction SilentlyContinue
If the VM is already protected the cmdlet will give an error

Debug Output

Enable-AzureRmRecoveryServicesBackupProtection -Policy $BackupProtectionPolicy -Name $VMName -ResourceGroupName $ResourceGroupName -ErrorAction SilentlyContinue -Debug
DEBUG: 12:02:12 - EnableAzureRmRecoveryServicesBackupProtection begin processing with ParameterSet 'AzureVMComputeEnableProtection'.
DEBUG: 12:02:13 - using account id '[email protected]'...
DEBUG: [Common.Authentication]: Authenticating using Account: '[email protected]', environment: 'AzureCloud', tenant: '96c09248-727b-4608-8ad9-31997e7ae230'
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13:  - TokenCache: Deserialized 11 items to token cache.

DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: '96c09248-727b-4608-8ad9-31997e7ae230', Endpoint: 'https://login.microsoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', Clie
ntRedirect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https://management.core.windows.net/', ValidateAuthrity: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/96c09248-727b-4608-8ad9-31997e7ae230/', CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority:
 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: '96c09248-727b-4608-8ad9-31997e7ae230', AdEndpoint: 'https://login.microsoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', 
ClientRedirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13: 2ff43cd9-6979-4a15-bd60-6739c9639b14 - AcquireTokenHandlerBase: === Token Acquisition started:
	Authority: https://login.microsoftonline.com/96c09248-727b-4608-8ad9-31997e7ae230/
	Resource: https://management.core.windows.net/
	ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
	CacheType: Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache (11 items)
	Authentication Target: User
	

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 11/02/2016 11:02:13: 2ff43cd9-6979-4a15-bd60-6739c9639b14 - TokenCache: Looking up cache for a token...

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13: 2ff43cd9-6979-4a15-bd60-6739c9639b14 - TokenCache: An item matching the requested resource was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 11/02/2016 11:02:13: 2ff43cd9-6979-4a15-bd60-6739c9639b14 - TokenCache: 17.67068756 minutes left until token in cache expires

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13: 2ff43cd9-6979-4a15-bd60-6739c9639b14 - TokenCache: A matching item (access token or refresh token or both) was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13: 2ff43cd9-6979-4a15-bd60-6739c9639b14 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned:
	Access Token Hash: tkYN/8LLL27dfMCtgDZrfJFOLCvLOACUGKwxnccPUBo=
	Refresh Token Hash: fpZSgDIGQYTvTkIcpHs86FKp9G7Om27RL7Z4SLptoQA=
	Expiration Time: 11/02/2016 11:19:53 +00:00
	User Hash: KwuGZ2uVK0Ncd6ny36LCfGbtqvVAVEQhKyRMkd0YToU=
	

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13:  - TokenCache: Serializing token cache with 11 items.

DEBUG: [Common.Authentication]: Received token with LoginType 'LiveId', Tenant: '96c09248-727b-4608-8ad9-31997e7ae230', UserId: '[email protected]'
DEBUG: InsideRestore. going to create ResourceManager Client
DEBUG: [Common.Authentication]: Authenticating using Account: '[email protected]', environment: 'AzureCloud', tenant: '96c09248-727b-4608-8ad9-31997e7ae230'
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13:  - TokenCache: Deserialized 11 items to token cache.

DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: '96c09248-727b-4608-8ad9-31997e7ae230', Endpoint: 'https://login.microsoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', Clie
ntRedirect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https://management.core.windows.net/', ValidateAuthrity: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/96c09248-727b-4608-8ad9-31997e7ae230/', CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority:
 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: '96c09248-727b-4608-8ad9-31997e7ae230', AdEndpoint: 'https://login.microsoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', 
ClientRedirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13: 251350a7-66a7-406b-ac0e-051b5b8ea647 - AcquireTokenHandlerBase: === Token Acquisition started:
	Authority: https://login.microsoftonline.com/96c09248-727b-4608-8ad9-31997e7ae230/
	Resource: https://management.core.windows.net/
	ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
	CacheType: Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache (11 items)
	Authentication Target: User
	

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 11/02/2016 11:02:13: 251350a7-66a7-406b-ac0e-051b5b8ea647 - TokenCache: Looking up cache for a token...

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13: 251350a7-66a7-406b-ac0e-051b5b8ea647 - TokenCache: An item matching the requested resource was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 11/02/2016 11:02:13: 251350a7-66a7-406b-ac0e-051b5b8ea647 - TokenCache: 17.6702625983333 minutes left until token in cache expires

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13: 251350a7-66a7-406b-ac0e-051b5b8ea647 - TokenCache: A matching item (access token or refresh token or both) was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13: 251350a7-66a7-406b-ac0e-051b5b8ea647 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned:
	Access Token Hash: tkYN/8LLL27dfMCtgDZrfJFOLCvLOACUGKwxnccPUBo=
	Refresh Token Hash: fpZSgDIGQYTvTkIcpHs86FKp9G7Om27RL7Z4SLptoQA=
	Expiration Time: 11/02/2016 11:19:53 +00:00
	User Hash: KwuGZ2uVK0Ncd6ny36LCfGbtqvVAVEQhKyRMkd0YToU=
	

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 11/02/2016 11:02:13:  - TokenCache: Serializing token cache with 11 items.

DEBUG: [Common.Authentication]: Received token with LoginType 'LiveId', Tenant: '96c09248-727b-4608-8ad9-31997e7ae230', UserId: '[email protected]'
DEBUG: Client Created successfully
DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '11/02/2016 11:19:53 +00:00', MultipleResource? 'True', Tenant: '96c09248-727b-4608-8ad9-31997e7ae230', UserId: '[email protected]'
DEBUG: [Common.Authentication]: User info for token DisplayId: '[email protected]', Name: Anders Spælling, IdProvider: 'live.com', Uid: 'a2fb01e6-16c6-48d7-aaa1-5a8c9ada89d5'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '11/02/2016 11:19:53 +00:00' Comparing to '11/02/2016 11:02:13 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:17:40.2072562'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupProtectableItems?api-version=2016-05-01

Headers:
x-ms-client-request-id        : c1b836c3-89d5-4970-bc6d-507176dcabd2-2016-11-02 11:02:13Z-PS

Body:



DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Pragma                        : no-cache
x-ms-request-id               : 01a66c36-053c-467c-9f0d-08bf3e33d268
x-ms-client-request-id        : c1b836c3-89d5-4970-bc6d-507176dcabd2-2016-11-02 11:02:13Z-PS,c1b836c3-89d5-4970-bc6d-507176dcabd2-2016-11-02 11:02:13Z-PS
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 14939
x-ms-correlation-request-id   : 01a66c36-053c-467c-9f0d-08bf3e33d268
x-ms-routing-request-id       : WESTEUROPE:20161102T105939Z:01a66c36-053c-467c-9f0d-08bf3e33d268
Cache-Control                 : no-cache
Date                          : Wed, 02 Nov 2016 10:59:39 GMT
Server                        : Microsoft-IIS/8.0
X-Powered-By                  : ASP.NET

Body:
{
  "value": [
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;datacompagniet;daco-dc-01/protectableItems/vm;iaasvmcontainerv2;datacompagniet;daco-dc-01",
      "name": "iaasvmcontainerv2;datacompagniet;daco-dc-01",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet/providers/Microsoft.Compute/virtualMachines/daco-dc-01",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "Datacompagniet",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "daco-dc-01",
        "protectionState": "NotProtected"
      }
    },
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;datacompagniet;daco-dc-02/protectableItems/vm;iaasvmcontainerv2;datacompagniet;daco-dc-02",
      "name": "iaasvmcontainerv2;datacompagniet;daco-dc-02",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet/providers/Microsoft.Compute/virtualMachines/daco-dc-02",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "Datacompagniet",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "daco-dc-02",
        "protectionState": "NotProtected"
      }
    },
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;lumabacon;lumabaconcli01/protectableItems/vm;iaasvmcontainerv2;lumabacon;lumabaconcli01",
      "name": "iaasvmcontainerv2;lumabacon;lumabaconcli01",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/LumaBacon/providers/Microsoft.Compute/virtualMachines/LumaBaconCli01",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "LumaBacon",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "LumaBaconCli01",
        "protectionState": "NotProtected"
      }
    },
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;lumabacon;lumabaconcli03/protectableItems/vm;iaasvmcontainerv2;lumabacon;lumabaconcli03",
      "name": "iaasvmcontainerv2;lumabacon;lumabaconcli03",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/LumaBacon/providers/Microsoft.Compute/virtualMachines/lumabaconcli03",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "LumaBacon",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "lumabaconcli03",
        "protectionState": "NotProtected"
      }
    },
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;svitzerrg01;sv01/protectableItems/vm;iaasvmcontainerv2;svitzerrg01;sv01",
      "name": "iaasvmcontainerv2;svitzerrg01;sv01",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/SvitzerRG01/providers/Microsoft.Compute/virtualMachines/SV01",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "SvitzerRG01",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "SV01",
        "protectionState": "NotProtected"
      }
    },
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;svitzerrg01;sv02/protectableItems/vm;iaasvmcontainerv2;svitzerrg01;sv02",
      "name": "iaasvmcontainerv2;svitzerrg01;sv02",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/SvitzerRG01/providers/Microsoft.Compute/virtualMachines/SV02",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "SvitzerRG01",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "SV02",
        "protectionState": "NotProtected"
      }
    }
  ]
}


DEBUG: Count of containers after BackupManagementType and friendlyName filter = 6
DEBUG: VM daco-fil-01 is not yet discovered. Triggering Discovery
DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '11/02/2016 11:19:53 +00:00', MultipleResource? 'True', Tenant: '96c09248-727b-4608-8ad9-31997e7ae230', UserId: '[email protected]'
DEBUG: [Common.Authentication]: User info for token DisplayId: '[email protected]', Name: Anders Spælling, IdProvider: 'live.com', Uid: 'a2fb01e6-16c6-48d7-aaa1-5a8c9ada89d5'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '11/02/2016 11:19:53 +00:00' Comparing to '11/02/2016 11:02:13 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:17:39.6806037'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
POST

Absolute Uri:
https://management.azure.com/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/refreshContainers?api-version=2016-05-
01

Headers:
x-ms-client-request-id        : c1b836c3-89d5-4970-bc6d-507176dcabd2-2016-11-02 11:02:13Z-PS

Body:



DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
Accepted

Headers:
Pragma                        : no-cache
Retry-After                   : 60
x-ms-request-id               : 5bde7374-62bf-401a-851e-040c0b6a3427
x-ms-client-request-id        : c1b836c3-89d5-4970-bc6d-507176dcabd2-2016-11-02 11:02:13Z-PS,c1b836c3-89d5-4970-bc6d-507176dcabd2-2016-11-02 11:02:13Z-PS
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-writes: 1197
x-ms-correlation-request-id   : 5bde7374-62bf-401a-851e-040c0b6a3427
x-ms-routing-request-id       : WESTEUROPE:20161102T105940Z:5bde7374-62bf-401a-851e-040c0b6a3427
Cache-Control                 : no-cache
Date                          : Wed, 02 Nov 2016 10:59:40 GMT
Location                      : https://management.azure.com/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/operat
ionResults/bece6d7b-4eca-4a1f-92b4-ff9514e3a574?api-version=2016-05-01
X-Powered-By                  : ASP.NET

Body:



DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '11/02/2016 11:19:53 +00:00', MultipleResource? 'True', Tenant: '96c09248-727b-4608-8ad9-31997e7ae230', UserId: '[email protected]'
DEBUG: [Common.Authentication]: User info for token DisplayId: '[email protected]', Name: Anders Spælling, IdProvider: 'live.com', Uid: 'a2fb01e6-16c6-48d7-aaa1-5a8c9ada89d5'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '11/02/2016 11:19:53 +00:00' Comparing to '11/02/2016 11:02:14 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:17:38.9739773'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/operationResults/bece6d7b-4eca-4a1f-92
b4-ff9514e3a574?api-version=2016-05-01

Headers:
x-ms-client-request-id        : 4f7450a2-bb9b-45c6-b2b1-a3f86c52aad1

Body:



DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
Accepted

Headers:
Pragma                        : no-cache
Retry-After                   : 60
x-ms-request-id               : 6ba51cdd-51d6-4565-9790-881243825369
x-ms-client-request-id        : 4f7450a2-bb9b-45c6-b2b1-a3f86c52aad1,4f7450a2-bb9b-45c6-b2b1-a3f86c52aad1
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 14938
x-ms-correlation-request-id   : 6ba51cdd-51d6-4565-9790-881243825369
x-ms-routing-request-id       : WESTEUROPE:20161102T105940Z:6ba51cdd-51d6-4565-9790-881243825369
Cache-Control                 : no-cache
Date                          : Wed, 02 Nov 2016 10:59:40 GMT
Location                      : https://management.azure.com/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/operat
ionResults/bece6d7b-4eca-4a1f-92b4-ff9514e3a574?api-version=2016-05-01
X-Powered-By                  : ASP.NET

Body:



DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '11/02/2016 11:19:53 +00:00', MultipleResource? 'True', Tenant: '96c09248-727b-4608-8ad9-31997e7ae230', UserId: '[email protected]'
DEBUG: [Common.Authentication]: User info for token DisplayId: '[email protected]', Name: Anders Spælling, IdProvider: 'live.com', Uid: 'a2fb01e6-16c6-48d7-aaa1-5a8c9ada89d5'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '11/02/2016 11:19:53 +00:00' Comparing to '11/02/2016 11:02:45 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:17:08.4638077'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/operationResults/bece6d7b-4eca-4a1f-92
b4-ff9514e3a574?api-version=2016-05-01

Headers:
x-ms-client-request-id        : 3d043b14-13f5-43c5-89df-2d76ed294a12

Body:



DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
NoContent

Headers:
Pragma                        : no-cache
x-ms-request-id               : dac6545c-b01c-49fe-a747-653d523eefd2
x-ms-client-request-id        : 3d043b14-13f5-43c5-89df-2d76ed294a12,3d043b14-13f5-43c5-89df-2d76ed294a12
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 14939
x-ms-correlation-request-id   : dac6545c-b01c-49fe-a747-653d523eefd2
x-ms-routing-request-id       : WESTEUROPE:20161102T110011Z:dac6545c-b01c-49fe-a747-653d523eefd2
Cache-Control                 : no-cache
Date                          : Wed, 02 Nov 2016 11:00:10 GMT
X-Powered-By                  : ASP.NET

Body:



DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '11/02/2016 11:19:53 +00:00', MultipleResource? 'True', Tenant: '96c09248-727b-4608-8ad9-31997e7ae230', UserId: '[email protected]'
DEBUG: [Common.Authentication]: User info for token DisplayId: '[email protected]', Name: Anders Spælling, IdProvider: 'live.com', Uid: 'a2fb01e6-16c6-48d7-aaa1-5a8c9ada89d5'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '11/02/2016 11:19:53 +00:00' Comparing to '11/02/2016 11:02:45 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:17:08.0136897'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupProtectableItems?api-version=2016-05-01

Headers:
x-ms-client-request-id        : c1b836c3-89d5-4970-bc6d-507176dcabd2-2016-11-02 11:02:13Z-PS

Body:



DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Pragma                        : no-cache
x-ms-request-id               : 80afe5de-d256-42d9-aa0e-2699ef721fda
x-ms-client-request-id        : c1b836c3-89d5-4970-bc6d-507176dcabd2-2016-11-02 11:02:13Z-PS,c1b836c3-89d5-4970-bc6d-507176dcabd2-2016-11-02 11:02:13Z-PS
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 14938
x-ms-correlation-request-id   : 80afe5de-d256-42d9-aa0e-2699ef721fda
x-ms-routing-request-id       : WESTEUROPE:20161102T110011Z:80afe5de-d256-42d9-aa0e-2699ef721fda
Cache-Control                 : no-cache
Date                          : Wed, 02 Nov 2016 11:00:11 GMT
Server                        : Microsoft-IIS/8.0
X-Powered-By                  : ASP.NET

Body:
{
  "value": [
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;datacompagniet;daco-dc-01/protectableItems/vm;iaasvmcontainerv2;datacompagniet;daco-dc-01",
      "name": "iaasvmcontainerv2;datacompagniet;daco-dc-01",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet/providers/Microsoft.Compute/virtualMachines/daco-dc-01",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "Datacompagniet",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "daco-dc-01",
        "protectionState": "NotProtected"
      }
    },
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;datacompagniet;daco-dc-02/protectableItems/vm;iaasvmcontainerv2;datacompagniet;daco-dc-02",
      "name": "iaasvmcontainerv2;datacompagniet;daco-dc-02",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet/providers/Microsoft.Compute/virtualMachines/daco-dc-02",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "Datacompagniet",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "daco-dc-02",
        "protectionState": "NotProtected"
      }
    },
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;lumabacon;lumabaconcli01/protectableItems/vm;iaasvmcontainerv2;lumabacon;lumabaconcli01",
      "name": "iaasvmcontainerv2;lumabacon;lumabaconcli01",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/LumaBacon/providers/Microsoft.Compute/virtualMachines/LumaBaconCli01",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "LumaBacon",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "LumaBaconCli01",
        "protectionState": "NotProtected"
      }
    },
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;lumabacon;lumabaconcli03/protectableItems/vm;iaasvmcontainerv2;lumabacon;lumabaconcli03",
      "name": "iaasvmcontainerv2;lumabacon;lumabaconcli03",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/LumaBacon/providers/Microsoft.Compute/virtualMachines/lumabaconcli03",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "LumaBacon",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "lumabaconcli03",
        "protectionState": "NotProtected"
      }
    },
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;svitzerrg01;sv01/protectableItems/vm;iaasvmcontainerv2;svitzerrg01;sv01",
      "name": "iaasvmcontainerv2;svitzerrg01;sv01",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/SvitzerRG01/providers/Microsoft.Compute/virtualMachines/SV01",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "SvitzerRG01",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "SV01",
        "protectionState": "NotProtected"
      }
    },
    {
      "id": "/Subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/Datacompagniet2/providers/Microsoft.RecoveryServices/vaults/BackupVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv
2;svitzerrg01;sv02/protectableItems/vm;iaasvmcontainerv2;svitzerrg01;sv02",
      "name": "iaasvmcontainerv2;svitzerrg01;sv02",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems",
      "properties": {
        "virtualMachineId": "/subscriptions/72615edd-32ed-48b6-be09-266117538d3c/resourceGroups/SvitzerRG01/providers/Microsoft.Compute/virtualMachines/SV02",
        "virtualMachineVersion": "Compute",
        "resourceGroup": "SvitzerRG01",
        "backupManagementType": "AzureIaasVM",
        "protectableItemType": "Microsoft.Compute/virtualMachines",
        "friendlyName": "SV02",
        "protectionState": "NotProtected"
      }
    }
  ]
}


DEBUG: Count of containers after BackupManagementType and friendlyName filter = 6
DEBUG: Failed to discover VM daco-fil-01 under Datacompagniet2 Microsoft.Compute. Please make sure names are correct and VM is not deleted"
DEBUG: Caught exception, type: System.Management.Automation.PipelineStoppedException
DEBUG: 12:02:46 - EnableAzureRmRecoveryServicesBackupProtection end processing.
DEBUG: 12:02:46 - EnableAzureRmRecoveryServicesBackupProtection end processing.
Enable-AzureRmRecoveryServicesBackupProtection : The specified Azure Virtual Machine Not Found. Possible causes are
1. VM does not exist
2. The VM name or the Service name needs to be case sensitive
3. VM is already Protected with same or other Vault. Please Unprotect VM first and then try to protect it again.
Please contact Microsoft for further assistant.
At line:1 char:1
+ Enable-AzureRmRecoveryServicesBackupProtection -Policy $BackupProtect ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Enable-AzureRmR...ackupProtection], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.EnableAzureRmRecoveryServicesBackupProtection

Script/Steps for Reproduction

Run

Enable-AzureRmRecoveryServicesBackupProtection -Policy $BackupProtectionPolicy -Name $VMName -ResourceGroupName $ResourceGroupName -ErrorAction SilentlyContinue

Twice

@spaelling
Copy link
Author

And there is a spelling error in

Please contact Microsoft for further assistant.

should be

Please contact Microsoft for further assistance.

@markcowl
Copy link
Member

markcowl commented Nov 2, 2016

@pragrawa @dragonfly91 @mkherani Please take a look, assess the issue, and assign to a milestone in the repo as appropriate

@pragrawa
Copy link
Contributor

pragrawa commented Nov 7, 2017

With upcoming Nov17 Azure PowerShell release, Enable-AzureRmRecoveryServicesBackupProtection will respect -ErrorAction SilentlyContinue functionality

@pragrawa pragrawa closed this as completed Nov 7, 2017
@bsiegel bsiegel added the Service Attention This issue is responsible by Azure service team. label Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Recovery Services Backup Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

6 participants