Skip to content

Conversation

@pensivepaddle
Copy link
Contributor

Perhaps not the best solution, but it works - running the ResourceGraph driver for "PolicyResources" without the addition returns incomplete list of results, with no obvious reason.

Noticed in the portal that not all results for a "PolicyResources"-query contain subscriptionId value, and the missing results correspond to those with "blank" values in the column.

By adding a blank string to the list, the expected results were returned.

Perhaps not the best solution, but it works - running the ResourceGraph driver for "PolicyResources" without the addition returns incomplete list of results, with no obvious reason. 

Noticed in the portal that not all results for a "PolicyResources"-query contain subscriptionId value, and the missing results correspond to those with "blank" values in the column.

By adding a blank string to the list, the expected results were returned.
self.subscription_ids = [
sub.subscription_id
for sub in self.sub_client.subscriptions.list() # type: ignore
for sub in self.sub_client.subscriptions.list().append("") # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be something like:

self.subscription_ids = [
            sub.subscription_id
            for sub in self.sub_client.subscriptions.list()
]
self.subscription_ids.append("")

.append() adds an item to an existing list but doesn't return anything.
Also "" is not going to have a "subscription_id" attribute.

@ianhelle
Copy link
Contributor

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ianhelle
Copy link
Contributor

ianhelle commented Nov 5, 2022

/azurepipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ianhelle ianhelle merged commit 16742a4 into microsoft:main Nov 5, 2022
ianhelle added a commit that referenced this pull request Feb 3, 2023
…ll resource graph queries - resource_graph_driver.py
petebryan added a commit that referenced this pull request Feb 3, 2023
…3-02-02

Reverting PR #496 - Removing blank sub-id from resource graph list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants