Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

AZtfexport - problem with big subscriptions

Aperta
#663 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
azure, github-actions, go, powershell, terraform

Direzione di ricerca

Inizia con lo script PowerShell che invoca l’entry point aztfexport resource-group, in particolare le sue esportazioni parallele e le directory di lavoro separate. Riproduci l’esecuzione con due sottoscrizioni e analizza gli errori di terraform init segnalati; il lavoro è completato quando è stato identificato se l’inizializzazione concorrente causa gli errori e viene documentato o risolto un modo affidabile per completare esportazioni di grandi dimensioni senza stato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

question

Hi
I try to do full export of all azure subscriptions in my tenant. I prepared script which perform export, and commit HCL files on github repository. Each of subscription has its own repo, so we run this script by github action. I use powershell parrarelism, so i run export for all of RG at once.
Unfortunately, some of them are big, Not because a lot of RG, but because of lots of resources. In one subscription we have aprox. 10k of resources, so exporting them takes a lot of time(more than 6 hours), so we hit github action limit. We decide to move this export to separate machine, and export many subscriptions at once. I try to do that with 2 subscriptions, and got this errors.

Error: initializing provider for the import directories: 5 errors occurred:
	* task error: error running terraform init: exit status 0xffffffff
	* task error: error running terraform init: exit status 0xffffffff
	* task error: error running terraform init: exit status 0xffffffff
	* task error: error running terraform init: exit status 0xffffffff
	* task error: error running terraform init: exit status 0xffffffff

Each of export has its own workDir, i use default pararel value(not using parameter, so stay at default value of 10). Is there any tips how can i handle my problem, or how can i decrese execution time? I don't need state, only HCL

This is part of code responsible for export

$resourceGroups = Get-AzResourceGroup

$resourceGroups | ForEach-Object {
    $rgName = $_.ResourceGroupName

    $exportPath = Join-Path -Path $Using:backupARMPath -ChildPath $Using:rgName | Join-Path -ChildPath "$resName.json"

    aztfexport resource-group --non-interactive `
        --subscription-id $subscriptionId `
        --output-dir $exportPath `
        --hcl-only=true `
        --append=false `
        --plain-ui `
        --exclude-azure-resource "secrets" `
        --exclude-azure-resource "systemTopics" `
        --exclude-azure-resource "certificates" `
        --exclude-azure-resource "listClusterUserCredential" `
        --exclude-azure-resource "tables/WADDiagnosticInfrastructureLogsTable" `
        --exclude-azure-resource "tables/WADMetricsPT1MP10DV2S20241010" `
        --exclude-azure-resource "tables/WADPerformanceCountersTable" `
        --exclude-azure-resource "virtualMachines/azure-*" `
        $rgName 2>&1 | Tee-Object -Variable result
} -ThrottleLimit 4

And I run this script for 2 subscriptions at once

Lingua principale
Go
Stelle
1.9k
Fork
220
Merge medio
2g 1h
PR unite (30g)
4

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/aztfexport

Tutte le issue di Azure/aztfexport

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.