Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion plugins/inventory/azure_kql.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
for how to craft your own query. The one requirement is that you need to provide inventory_hostname.
- Requires a YAML configuration file whose name ends with 'azure_kql.(yml|yaml)'
- Be aware that currently Azure Resource Graph may not be consistent with the actual state of your
resources. It can take up to 30 minutes for updates to propagate. This applies both for resources
resources. It can take up to 30 hours for updates to propagate. This applies both for resources
to appear and to dissapear.
Microsoft also makes no guarantees that the information contained is accurate. It happens that
attributes (such as the PowerState) or entire VMs simply have an incorrect state, disappear and/or
reappear in different queries.
Comment on lines +24 to +26
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reference to support this part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you have access to support requests you can check 2406170050002212 -- but no, from my opinion that's not properly documented in the public graph docs, same as the potential 30 hour lag, I've complained about that, but it's nothing MSFT wants to fix apparently

Copy link
Collaborator

Choose a reason for hiding this comment

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

I hope at least you can put some reference about how ARG works and why it can cause these issues, to make the material more sensible.. Otherwise, I don't think anyone will use this inventory.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, that's the point I am making, the graph service is not usable for an inventory if you have the expectation that your inventory shows accurate & live data :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yet we have a customer who is using it for inventory. And so far my automated tests have not shown any issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My guess would be they are not sensitive enough to change. For example the stuff with the powerstate="" in Graph I only noticed because some VMs where not updated in their maintenance windows, but only super rarely. I started to export my inventory to git after each sync in order to see changes, that's when I caught up to the general problems. Sometimes a VM would be in it, sometimes it would not be in it, sometimes a Powerstate was "" instead of the actual powerstate. According to MSFT this is all "by design". If that kind of inventory is okay for a customer they can feel free to use it. But it needs to be with a big warning sign because it's not what an actual inventory should be, which is live & accurate information -- or an error.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If ARG is behaving inproperly and MSFT claimed it was by design, then in what scenario is ARG supposed to be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@magodo that's actually the same question I posed to MSFT and they failed to come up with an answer :) I am guessing it shall be used to situations where neither accuracy/completeness nor time is an immediate factor. The only answer I came up in my head: statistics over your whole environment when you have thousands of machines and it's not important if there is one or more in the results or if one is powered on or simply "" :D . But at least in my ansible world that's not an option, there are important tasks running that rely on the accuracy of the information.

'''

EXAMPLES = '''
Expand Down