Agentless, cloud-native backup for Microsoft Azure
Post Reply
user01
Novice
Posts: 5
Liked: 1 time
Joined: Mar 20, 2024 6:08 pm
Full Name: vala pajouhi
Contact:

having issue restoring to alternative location using API

Post by user01 »

HI all,
I am trying to use appliance API to restore from backup to alternate location(another azure subscription)
I get below error when I try to restore using :
https://helpcenter.veeam.com/docs/vbazu ... _RestoreVm


Error: Unable to parse the subscription id in the given resource id: string
lyudmila.ezerskaya
Veeam Software
Posts: 109
Liked: 34 times
Joined: Oct 04, 2021 4:08 pm
Full Name: Lyudmila Ezerskaya
Contact:

Re: having issue restoring to alternative location using API

Post by lyudmila.ezerskaya »

Hi,

It seems like you might have entered the wrong subscription ID in the request. However, without details, it's hard to resolve this through the forums. Please open a support case for this issue and share the case ID with us for future reference, as per our forum rules.

Thanks!
user01
Novice
Posts: 5
Liked: 1 time
Joined: Mar 20, 2024 6:08 pm
Full Name: vala pajouhi
Contact:

Re: having issue restoring to alternative location using API

Post by user01 »

Thank you for reply, I already had Case # 07174979 open but they suggest to post it here

We are trying to recover from subscritipon1:81d11f00-bc1a-4f4f-88b4-733a4a06746e to
subscription2:61e69ca9-4ea9-4e0f-b8cd-cf234dced275


here is the json I am using

Code: Select all

{
    "sourceServiceAccountId":  "a1702da5-e74a-4a15-ab8a-27cdeebb8095",
    "startVmAfterRestore":  "True",
    "toAlternative":  {
                          "virtualNetwork":  {
                                                 "addressSpaces":  [
                                                                       "10.10.0.0"
                                                                   ],
                                                 "name":  "RecoveryVnet",
                                                 "id":  "/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/an000001/providers/microsoft.network/virtualnetworks/recoveryvnet",
                                                 "regionName":  "East US"
                                             },
                          "dataDisks":  [
                                            {
                                                "resourceGroup":  {
                                                                      "id":  "8x3fc3amd9qgopjrz5ytg5bekdxpwhgwckdcprrp5cegazesm3ny",
                                                                      "name":  "veeamprotected",
                                                                      "resourceId":  "/subscriptions/81d11f00-bc1a-4f4f-88b4-733a4a06746e/resourcegroups/veeamprotected",
                                                                      "azureEnvironment":  "Global",
                                                                      "regionId":  "eastus",
                                                                      "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275"
                                                                  },
                                                "diskId":  "tponfsa7u8yfyriixmnzga3x785utbco9aw7njp8p1q8mj8qwrjy",
                                                "name":  "Veeam.Snapshot.3bc4775b-1fda-4007-b6fb-ab7575fe6192",
                                                "storageAccount":  {
                                                                       "performance":  "Standard",
                                                                       "id":  "string",
                                                                       "isImmutableStorage":  "False",
                                                                       "supportsTiering":  "True",
                                                                       "name":  "string",
                                                                       "isImmutableStoragePolicyLocked":  "True",
                                                                       "removedFromAzure":  "False",
                                                                       "redundancy":  "RAGRS",
                                                                       "skuName":  "string",
                                                                       "accessTier":  "hot",
                                                                       "regionId":  "string",
                                                                       "resourceId":  "string",
                                                                       "regionName":  "string"
                                                                   }
                                            }
                                        ],
                          "networkSecurityGroup":  {
                                                       "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275",
                                                       "regionId":  "eastus",
                                                       "name":  "RDP",
                                                       "id":  "/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/an000001/providers/microsoft.network/networksecuritygroups/rdp",
                                                       "resourceGroupName":  "an000001"
                                                   },
                          "resourceGroup":  {
                                                "id":  "nw4x7t6sezdwebxxkhdmq6e66zsiuz4q67czpp18r5gsz6s4wxby",
                                                "name":  "recoveredVM",
                                                "resourceId":  "/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/recoveredvm",
                                                "azureEnvironment":  "Global",
                                                "regionId":  "eastus",
                                                "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275"
                                            },
                          "name":  "windows-AzureDiskEncryption",
                          "osDisk":  {
                                         "resourceGroup":  {
                                                               "id":  "8x3fc3amd9qgopjrz5ytg5bekdxpwhgwckdcprrp5cegazesm3ny",
                                                               "name":  "veeamprotected",
                                                               "resourceId":  "/subscriptions/81d11f00-bc1a-4f4f-88b4-733a4a06746e/resourcegroups/veeamprotected",
                                                               "azureEnvironment":  "Global",
                                                               "regionId":  "eastus",
                                                               "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275"
                                                           },
                                         "diskId":  "j8i7ocia7jyi9te5cqsy1yzagzkqzoc44mqm1jcsoouynkmxtpuo",
                                         "name":  "Veeam.Snapshot.142c179e-9f12-4480-8745-0565a8b27135",
                                         "storageAccount":  {
                                                                "performance":  "Standard",
                                                                "id":  "",
                                                                "isImmutableStorage":  "False",
                                                                "supportsTiering":  "True",
                                                                "name":  "",
                                                                "isImmutableStoragePolicyLocked":  "True",
                                                                "removedFromAzure":  "False",
                                                                "redundancy":  "RAGRS",
                                                                "skuName":  "",
                                                                "accessTier":  "hot",
                                                                "regionId":  "",
                                                                "resourceId":  "",
                                                                "regionName":  ""
                                                            }
                                     },
                          "region":  {
                                         "id":  "eastus",
                                         "name":  "East US"
                                     },
                          "availabilityZone":  {
                                                   "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275",
                                                   "regionId":  "eastus",
                                                   "name":  "1"
                                               },
                          "subnet":  {
                                         "addressSpace":  "10.10.1.0/24",
                                         "networkSecurityGroup":  {
                                                                      "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275",
                                                                      "regionId":  "eastus",
                                                                      "name":  "RDP",
                                                                      "id":  "/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/an000001/providers/microsoft.network/networksecuritygroups/rdp",
                                                                      "resourceGroupName":  "an000001"
                                                                  },
                                         "name":  "subnet1"
                                     },
                          "vmSizeName":  "Standard_D2s_v3",
                          "availabilityset":  {
                                                  "name":  "",
                                                  "Id":  "",
                                                  "regionName":  ""
                                              },
                          "diskType":  "Managed",
                          "subscription":  {
                                               "id":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275",
                                               "tenantName":  "AN00001",
                                               "name":  "AN00001",
                                               "availability":  "Available",
                                               "tenantId":  "a93583b6-1e0a-4a6b-b645-0de677b6613f",
                                               "status":  "Active"
                                           }
                      },
    "reason":  "testing",
    "serviceAccountId":  "9aed421c-cc89-4efa-9433-1f89228d6eb7"
}
lyudmila.ezerskaya
Veeam Software
Posts: 109
Liked: 34 times
Joined: Oct 04, 2021 4:08 pm
Full Name: Lyudmila Ezerskaya
Contact:

Re: having issue restoring to alternative location using API

Post by lyudmila.ezerskaya »

Hi!
Based on the provided JSON, it seems that you have specified the resource groups for OS and data disks from the source subscription. However, the 'toAlternative' subscheme should include target settings such as virtual network, network security group, resource groups for VM and disks, and so on.

Also, please double-check the format of the address space specified for your virtual network.

With best regards,
Lyudmila
user01
Novice
Posts: 5
Liked: 1 time
Joined: Mar 20, 2024 6:08 pm
Full Name: vala pajouhi
Contact:

Re: having issue restoring to alternative location using API

Post by user01 »

Thank you for your reply, since diskId and name are from source I was not sure. I changed the Resource group as you instructed but getting different error related to subscription.
need to look into this now. I will let you know, thanks again

Code: Select all

25.03.2024 11:15:17.976] Error     6 (1) Error: The access token is from the wrong issuer 'https://sts.windows.net/a93583b6-1e0a-4a6b-b645-0de677b6613f/'. It must match the tenant 'https://sts.windows.net/36755071-be25-47f9-9fc5-529d0fc339f5/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/36755071-be25-47f9-9fc5-529d0fc339f5' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later.
Status: 401 (Unauthorized)
ErrorCode: InvalidAuthenticationTokenTenant

Content:
{"error":{"code":"InvalidAuthenticationTokenTenant","message":"The access token is from the wrong issuer 'https://sts.windows.net/a93583b6-1e0a-4a6b-b645-0de677b6613f/'. It must match the tenant 'https://sts.windows.net/36755071-be25-47f9-9fc5-529d0fc339f5/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/36755071-be25-47f9-9fc5-529d0fc339f5' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later."}}

Headers:
Cache-Control: no-cache
Pragma: no-cache
WWW-Authenticate: Bearer authorization_uri="https://login.windows.net/36755071-be25-47f9-9fc5-529d0fc339f5", error="invalid_token", error_description="The access token is from the wrong issuer. It must match the tenant associated with this subscription. Please use correct authority to get the token."
x-ms-failure-cause: REDACTED
x-ms-request-id: b08925d7-6d48-4ac4-a566-207f1f487e90
x-ms-correlation-request-id: REDACTED
x-ms-routing-request-id: REDACTED
Strict-Transport-Security: REDACTED
X-Content-Type-Options: REDACTED
X-Cache: REDACTED
X-MSEdge-Ref: REDACTED
Date: Mon, 25 Mar 2024 15:15:17 GMT
Content-Length: 677
Content-Type: application/json; charset=utf-8
Expires: -1
lyudmila.ezerskaya
Veeam Software
Posts: 109
Liked: 34 times
Joined: Oct 04, 2021 4:08 pm
Full Name: Lyudmila Ezerskaya
Contact:

Re: having issue restoring to alternative location using API

Post by lyudmila.ezerskaya »

Hi!
It looks like an authentication issue.

Please verify that the sourceServiceAccountId belongs to a service account from the source subscription, and the serviceAccountId is the ID of the service account that has permissions to access the target subscription and tenant.
user01
Novice
Posts: 5
Liked: 1 time
Joined: Mar 20, 2024 6:08 pm
Full Name: vala pajouhi
Contact:

Re: having issue restoring to alternative location using API

Post by user01 »

don't get this. here is the error saying he access token is from the wrong issuer
The access token is from the wrong issuer 'https://sts.windows.net/a93583b6-1e0a-4 ... 677b6613f/'.
It must match the tenant 'https://sts.windows.net/36755071-be25-4 ... d0fc339f5/' associated with this subscription.

the Original VM which c we protect is here is here

Code: Select all

accountId                    : 9aed421c-cc89-4efa-9433-1f89228d6eb7
applicationId                : 899c75e7-f232-46d1-9b3e-35042fe6c2b9
name                         : an00001-RPSManaged
description                  : Created by an00001-RPSveeamappliance\cn00001admin at 3/4/2024 7:41 PM
region                       : Global
tenantId                     : a93583b6-1e0a-4a6b-b645-0de677b6613f
accountOrigin                : Imported Secret
accountState                 : Created
purposes                     : {WorkerManagement, Repository, VirtualMachineBackup, VirtualMachineRestore...}
subscriptionIds              : {61e69ca9-4ea9-4e0f-b8cd-cf234dced275}
selectedForWorkermanagement  : True
lighthouseSubscriptionsCount : 0
_links                       : @{self=; subscriptions=n
we restoring from backup which is on blob storage on destination
Veeam appliance also live here, we restore to :

Code: Select all

accountId                    : a1702da5-e74a-4a15-ab8a-27cdeebb8095
applicationId                : 9eca89dd-2aaf-44e5-90dc-897c519caab3
name                         : RPS Canada
description                  :
region                       : Global
tenantId                     : 36755071-be25-47f9-9fc5-529d0fc339f5
accountOrigin                : Device Authentication
expirationDate               : 2025-03-05T16:11:09.880942Z
accountState                 : Created
purposes                     : {Repository, VirtualMachineBackup, VirtualMachineRestore, AzureSqlBackup...}
subscriptionIds              : {81d11f00-bc1a-4f4f-88b4-733a4a06746e, 83a4220b-ac2d-49d6-b447-4008fadf43f2}
selectedForWorkermanagement  : False
lighthouseSubscriptionsCount : 0
_links                       : @{self=; subscriptions=}

this is the json

Code: Select all

{
    "sourceServiceAccountId":  "a1702da5-e74a-4a15-ab8a-27cdeebb8095",
    "startVmAfterRestore":  "True",
    "toAlternative":  {
                          "virtualNetwork":  {
                                                 "addressSpaces":  [
                                                                       "10.10.0.0"
                                                                   ],
                                                 "name":  "RecoveryVnet",
                                                 "id":  "/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/an000001/providers/microsoft.network/virtualnetworks/recoveryvnet",
                                                 "regionName":  "East US"
                                             },
                          "dataDisks":  [
                                            {
                                                "resourceGroup":  {
                                                                      "id":  "nw4x7t6sezdwebxxkhdmq6e66zsiuz4q67czpp18r5gsz6s4wxby",
                                                                      "name":  "recoveredVM",
                                                                      "resourceId":  "/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/recoveredvm",
                                                                      "azureEnvironment":  "Global",
                                                                      "regionId":  "eastus",
                                                                      "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275"
                                                                  },
                                                "diskId":  "tponfsa7u8yfyriixmnzga3x785utbco9aw7njp8p1q8mj8qwrjy",
                                                "name":  "Veeam.Snapshot.2bd17696-5d99-46a4-be60-649c7f7f1f5f",
                                                "storageAccount":  {
                                                                       "performance":  "Standard",
                                                                       "id":  "@{id=5bsiqofpeq8qdguofzq8s7oyjk3gywnusiscmf3qd1568gweoh6o; resourceId=/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/an000001/providers/microsoft.storage/storageaccounts/an00001; name=an00001; skuName=Standard_ZRS; performance=Standard; redundancy=ZRS; accessTier=Cool; regionId=eastus; regionName=East US; removedFromAzure=False; supportsTiering=True; isImmutableStorage=False; isImmutableStoragePolicyLocked=False; _links=}",
                                                                       "isImmutableStorage":  "False",
                                                                       "supportsTiering":  "True",
                                                                       "name":  "an00001",
                                                                       "isImmutableStoragePolicyLocked":  "True",
                                                                       "removedFromAzure":  "False",
                                                                       "redundancy":  "RAGRS",
                                                                       "skuName":  "Standard_ZRS",
                                                                       "accessTier":  "hot",
                                                                       "regionId":  "eastus",
                                                                       "resourceId":  "/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/an000001/providers/microsoft.storage/storageaccounts/an00001",
                                                                       "regionName":  "East US"
                                                                   }
                                            }
                                        ],
                          "networkSecurityGroup":  {
                                                       "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275",
                                                       "regionId":  "eastus",
                                                       "name":  "RDP",
                                                       "id":  "",
                                                       "resourceGroupName":  ""
                                                   },
                          "resourceGroup":  {
                                                "id":  "nw4x7t6sezdwebxxkhdmq6e66zsiuz4q67czpp18r5gsz6s4wxby",
                                                "name":  "recoveredVM",
                                                "resourceId":  "/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/recoveredvm",
                                                "azureEnvironment":  "Global",
                                                "regionId":  "eastus",
                                                "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275"
                                            },
                          "name":  "windows-AzureDiskEncryption",
                          "osDisk":  {
                                         "resourceGroup":  {
                                                               "id":  "nw4x7t6sezdwebxxkhdmq6e66zsiuz4q67czpp18r5gsz6s4wxby",
                                                               "name":  "recoveredVM",
                                                               "resourceId":  "/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/recoveredvm",
                                                               "azureEnvironment":  "Global",
                                                               "regionId":  "eastus",
                                                               "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275"
                                                           },
                                         "diskId":  "j8i7ocia7jyi9te5cqsy1yzagzkqzoc44mqm1jcsoouynkmxtpuo",
                                         "name":  "Veeam.Snapshot.3202e3cb-715d-4a7c-bb5e-ff6908ed24c7",
                                         "storageAccount":  {
                                                                "performance":  "Standard",
                                                                "id":  "@{id=5bsiqofpeq8qdguofzq8s7oyjk3gywnusiscmf3qd1568gweoh6o; resourceId=/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/an000001/providers/microsoft.storage/storageaccounts/an00001; name=an00001; skuName=Standard_ZRS; performance=Standard; redundancy=ZRS; accessTier=Cool; regionId=eastus; regionName=East US; removedFromAzure=False; supportsTiering=True; isImmutableStorage=False; isImmutableStoragePolicyLocked=False; _links=}",
                                                                "isImmutableStorage":  "False",
                                                                "supportsTiering":  "True",
                                                                "name":  "an00001",
                                                                "isImmutableStoragePolicyLocked":  "True",
                                                                "removedFromAzure":  "False",
                                                                "redundancy":  "RAGRS",
                                                                "skuName":  "Standard_ZRS",
                                                                "accessTier":  "hot",
                                                                "regionId":  "eastus",
                                                                "resourceId":  "/subscriptions/61e69ca9-4ea9-4e0f-b8cd-cf234dced275/resourcegroups/an000001/providers/microsoft.storage/storageaccounts/an00001",
                                                                "regionName":  "East US"
                                                            }
                                     },
                          "region":  {
                                         "id":  "eastus",
                                         "name":  "East US"
                                     },
                          "availabilityZone":  {
                                                   "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275",
                                                   "regionId":  "eastus",
                                                   "name":  "1"
                                               },
                          "subnet":  {
                                         "addressSpace":  "10.10.1.0/24",
                                         "networkSecurityGroup":  {
                                                                      "subscriptionId":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275",
                                                                      "regionId":  "eastus",
                                                                      "name":  "RDP",
                                                                      "id":  "",
                                                                      "resourceGroupName":  ""
                                                                  },
                                         "name":  "subnet1"
                                     },
                          "vmSizeName":  "Standard_D2s_v3",
                          "availabilityset":  {
                                                  "name":  "",
                                                  "Id":  "",
                                                  "regionName":  ""
                                              },
                          "diskType":  "Managed",
                          "subscription":  {
                                               "id":  "61e69ca9-4ea9-4e0f-b8cd-cf234dced275",
                                               "tenantName":  "AN00001",
                                               "name":  "AN00001",
                                               "availability":  "Available",
                                               "tenantId":  "a93583b6-1e0a-4a6b-b645-0de677b6613f",
                                               "status":  "Active"
                                           }
                      },
    "reason":  "testing",
    "serviceAccountId":  "9aed421c-cc89-4efa-9433-1f89228d6eb7"
}
nielsengelen
Product Manager
Posts: 5636
Liked: 1181 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: having issue restoring to alternative location using API

Post by nielsengelen »

Hi Vala,

If you try to restore this VM to another location using our UI, does it work then? As at a first glance, I can't see a mistake so it should work.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
user01
Novice
Posts: 5
Liked: 1 time
Joined: Mar 20, 2024 6:08 pm
Full Name: vala pajouhi
Contact:

Re: having issue restoring to alternative location using API

Post by user01 » 1 person likes this post

thank you all, I was able to start the restore process.
I just noticed my "networkSecurityGroup" was missing id and RG. so had to fix this:
"networkSecurityGroup": {
"subscriptionId": "61e69ca9-4ea9-4e0f-b8cd-cf234dced275",
"regionId": "eastus",
"name": "RDP",
"id": "",
"resourceGroupName": ""
nielsengelen
Product Manager
Posts: 5636
Liked: 1181 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: having issue restoring to alternative location using API

Post by nielsengelen »

Hi Vala,

Thanks for the update. Glad it works now.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests