Restore Azure fileshare across subscription fails with ResourceGroupNotFound
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### **This is autogenerated. Please review and update as needed.**
## Describe the bug
When using `az backup restore-azurefileshare` to restore a fileshare across subscriptions, the target resource group can not be found.
**Command Name**
`az backup restore restore-azurefileshare`
**Errors:**
```
(ResourceGroupNotFound) Resource group 'rg-target-storage' could not be found.
Code: ResourceGroupNotFound
Message: Resource group 'rg-target-storage' could not be found.
```
## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
### Prerequisites:
- Create Storage Account `sasource` in Resource Group `rg-source-storage` on subscription `s_source`
- Create Azure FileShare in `sasource` named `myfileshare`
- Create Storage Account `satarget` in Resource Group `rg-target-storage`on subscription `s_target`
- Create Azure FileShare in `satarget` namend `my-fileshare`
- Create Recovery Vault `my-vault` in resource group `rg-my-vault` on subscription `s_source`
- Create & assign backup policy on `myfileshare` of `sasource` in `my-vault`
- Create a backup of `myfileshare` in `my-vault`
### Restore using az cli:
- `az login`
- `az account set --subscription s_target`
- `az backup restore restore-azurefileshare --resolve-conflict Overwrite --restore-mode AlternateLocation --vault-name my-vault --resource-group rg-my-vault --subscription s_source --target-storage-account satarget --target-resource-group-name rg-target-storage --target-file-share my-fileshare --container-name "StorageContainer;Storage;rg-source-storage;sasource" --item-name backupItem --rp-name 235172362713809 --verbose`
## Expected Behavior
Start restoring files to the target file share `my-fileshare` in storage account `satarget`.
## Environment Summary
```
Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.35, Ubuntu 22.04.5 LTS
Python 3.12.8
Installer: DEB
azure-cli 2.71.0
Extensions:
application-insights 1.2.3
azure-devops 1.0.1
k8s-configuration 2.2.0
k8s-extension 1.6.4
maintenance 1.4.0
ml 2.36.1
monitor-control-service 1.2.0
resource-mover 1.0.0b2
ssh 2.0.6
storage-preview 1.0.0b5
Dependencies:
msal 1.31.2b1
azure-mgmt-resource 23.1.1
```
## Additional Context
Using Azure Portal to restore the fileshare across subscriptions works as expected.
Contributor guide
Assessment
This issue has not been assessed yet.