aztfexport icon indicating copy to clipboard operation
aztfexport copied to clipboard

aztfty unable to export resource group more that 200 templates

Open manjeetsinghcodz opened this issue 2 years ago • 7 comments

Hello,

i have following error when doing an import :

aztfy XXXX exporting arm template of resource group XXXXX: resources.GroupsClient#ExportTemplate: Failure sending request: StatusCode=0 -- Original
Error: autorest/azure: Service returned an error. Status= Code="ExportTemplateResourcesLimitExceeded" Message="Export template is not supported for resource groups that have more than '200' resources." <<<

Please help. Thank you

manjeetsinghcodz avatar Apr 26 '22 09:04 manjeetsinghcodz

@manjeetsinghcodz Thank you for submitting this!

This is because currently aztfy is using the ARM template to do the resource listing and dependency resolvation. As seen from the error message, ARM template export has limitation of up to 200 resources. We are planning to strip the dependency on ARM template, but need efforts to make it happen.

magodo avatar Apr 26 '22 09:04 magodo

@magodo thanks for this info. but is there a way to import only one resource from a resource-group with aztfy ?

manjeetsinghcodz avatar Apr 26 '22 09:04 manjeetsinghcodz

@manjeetsinghcodz You can do that via https://github.com/magodo/tfadd, which is used by aztfy under the hood.

magodo avatar Apr 27 '22 00:04 magodo

@manjeetsinghcodz You can do that via https://github.com/magodo/tfadd, which is used by aztfy under the hood.

Hi @magodo , but for this...i do need to create the tf file first and it'll like an import? Or not? I didn't understand well how to use the tfadd to import, like, a VM or an app gateway

rtorato avatar Jul 07 '22 13:07 rtorato

@rtorato You can check out the readme: https://github.com/magodo/tfadd#usage. Once https://github.com/Azure/aztfy/pull/166 is merged, there would be first class subcommand for the single resource scenario.

magodo avatar Jul 07 '22 15:07 magodo

@rtorato You can check out the readme: https://github.com/magodo/tfadd#usage. Once #166 is merged, there would be first class subcommand for the single resource scenario.

Awesome. I'll wait for the merge and test, posting the feedbacks after completing

rtorato avatar Jul 07 '22 19:07 rtorato

@rtorato v0.6.0 is now released.

magodo avatar Jul 22 '22 03:07 magodo