-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Azure fileshare backup resource failing with message - storage account not registered with vault , but its already registered #11184
Comments
failed with both terraform providers 2.53 , 2.46.1 |
any update on this |
👍 |
The same HCL fails under certain conditions only:
resource azurerm_backup_protected_file_share minecraft_data {
resource_group_name = azurerm_resource_group.minecraft.name
recovery_vault_name = azurerm_recovery_services_vault.backup.0.name
source_storage_account_id = azurerm_storage_account.minecraft.id
source_file_share_name = module.minecraft[each.key].container_data_share_name
backup_policy_id = azurerm_backup_policy_file_share.nightly.0.id
depends_on = [azurerm_backup_container_storage_account.minecraft]
for_each = var.enable_backup ? toset(keys(var.minecraft_config)) : []
}
|
Any update on this one? I am experiencing the same error. terraform -v
I found another workaround is to go into the recovery services vault and go through the steps to add the file share manually. Once the select file shares screen refreshes with the new share you can cancel out and run successfully in Terraform. |
Another workaround is to use deploy this as an ARM deployment. resource "azurerm_resource_group_template_deployment" "fs" { name = "replacedeploymentname" template_content = file("${path.module}/arm/arm.json") parameters_content = jsonencode({ deployment_mode = "Incremental" }contents of ./arm/arm.json is as follows { |
when using the azurerm_backup_container_storage_account resource to register storage account with the recovery service vault, depends_on should be used explicitly declare the dependency to make sure the registration is completed before creating the azurerm_backup_protected_file_share like this: resource "azurerm_backup_protected_file_share" "share1" { Try adding the |
@sinbai This is NOT a depends on problem, below are the scenarios that I have been able to repro this issue Existing infra If I used terraform code to create share02 and share03(storageexample01) and then enable backup for these 2 shares on this RSV then the above error is returned. New Infra |
@KannappanSomu I can reproduce this issue based on your TF config, and verified it can be fixed after adding |
sure , will update you soon . |
This functionality has been released in v2.86.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform (and AzureRM Provider) Version
terraform 0.14.7
tried with both azure provider 2.53 and 2.46.1
Affected Resource(s)
azurerm_backup_protected_file_share
Terraform Configuration Files
Debug Output
Panic Output
2021-04-01T00:09:55.1007600Z Error: [ERROR] fileshare XXXXXXXX not found in protectable or protected fileshares, make sure Storage Account "kapdatadev" is registered with Recovery Service Vault "kap-recovery-vault" (Resource Group "XXXXXXX")
2021-04-01T00:09:55.1008458Z
2021-04-01T00:09:55.1008991Z on modules\azure-storage-share\main.tf line 13, in resource "azurerm_backup_protected_file_share" "share1":
2021-04-01T00:09:55.1009601Z 13: resource "azurerm_backup_protected_file_share" "share1" {
2021-04-01T00:09:55.1009823Z
Expected Behaviour
the storage account is already registerd with recovery vault & so it should create backup of fileshare
Actual Behaviour
2021-04-01T00:09:55.1007600Z Error: [ERROR] fileshare XXXXX not found in protectable or protected fileshares, make sure Storage Account "kapdatadev" is registered with Recovery Service Vault "kap-recovery-vault" (Resource Group "XXXXXXXX")
2021-04-01T00:09:55.1008458Z
2021-04-01T00:09:55.1008991Z on modules\azure-storage-share\main.tf line 13, in resource "azurerm_backup_protected_file_share" "share1":
2021-04-01T00:09:55.1009601Z 13: resource "azurerm_backup_protected_file_share" "share1" {
2021-04-01T00:09:55.1009823Z
Steps to Reproduce
terraform apply
Comments:
I believe this is a bug in terraform after some recent changes in flishare API. Its working with following workaround
workaround :
Enable back up manually for fileshare &
then stop the backup again
and rerun terraform apply step
The text was updated successfully, but these errors were encountered: