[issue] import never works - context deadline exceeded
Whenever i try to run aztfexport i always get the same error:
exit status 1
Error: reading resource group: resources.GroupsClient#Get: Failure sending request: StatusCode=0 -- Original Error: context deadline exceeded
no matter if it's 2 resources or 100. When i launch the import, the status bar stays on 0% and then it fails after a couple of minutes.
i have contributor role on the subscription level.
My steps are (using a cmd prompt on W11): az login (i also have to az login to msgraph) az account set (on the subscription i want to export resources from) aztfexport rg resource-group-name
For reference, these are the versions of things i'm using: aztfexport 0.17.1 az cli 2.70.0 terraform 1.11.2
@jonfen93 Have you tried to run terraform import azurerm_resource_group.<name> <id> with the same setup?
So it's weird. For some resource groups the aztfexport worked flawlessly (i.e. some storage accounts, a cognitive service). I have now tried to export a data factory, a logic app and an api connection and it failed with the same error.
When i tried to run the terraform import it worked fine.
It seems to me that when I try to export several resources (more than 50) I get the 'context deadline exceeded'.
One potential reason is that your subscription is under threshold, which causes the provider to retry (up to 3 times, iirc). While the read timeout of most AzureRM resources are set to 5min, hence you get the timeout error. You can verify that by enable debug log: --log-path and --log-level.