Skip to content

RG mode: Two step list, rg itself (incl. ext), then resources (incl. ext) in it#576

Merged
magodo merged 1 commit intoAzure:mainfrom
magodo:rg_list
Nov 12, 2024
Merged

RG mode: Two step list, rg itself (incl. ext), then resources (incl. ext) in it#576
magodo merged 1 commit intoAzure:mainfrom
magodo:rg_list

Conversation

@magodo
Copy link
Copy Markdown
Collaborator

@magodo magodo commented Nov 12, 2024

This PR is a fix for the #574, which doesn't handle exporting the extension resources assigned to an empty resource group. The reason is that azlist by default query resources from the ARG Resources table, if a resource group is empty, then the query by resource group name won't return any resource, and we end up explicitly add this empty resource group to the resource list, but didn't check if any ext resource exists on it.

This PR fixes this by firstly listing the RG itself, with any ext resource if any, from the ResourceContainers table. Then, if the RG exists, we'll further list the resources in it, including the ext resources, from the Resources table.

Fix #573. Supersedes #575.

Test

A non-empty RG:

image

An empty RG:

image

@magodo magodo added the bug Something isn't working label Nov 12, 2024
@magodo magodo requested a review from ms-henglu November 12, 2024 00:58
@magodo magodo mentioned this pull request Nov 12, 2024
@magodo
Copy link
Copy Markdown
Collaborator Author

magodo commented Nov 12, 2024

/azp list

@azure-pipelines
Copy link
Copy Markdown

No pipelines found for this repository.

@YanaXu
Copy link
Copy Markdown
Collaborator

YanaXu commented Nov 12, 2024

/azp list

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 576 in repo Azure/aztfexport

@magodo
Copy link
Copy Markdown
Collaborator Author

magodo commented Nov 12, 2024

/azp where

@magodo magodo merged commit 2dcb4e9 into Azure:main Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--include-role-assignment not working

3 participants