NodeID displays null values in SWQL


I am trying to join Orion.nodes table with Cloud.Azure.Instances on NodeID. However, in few of my nodes, the NodeID is showing Null which leads to incorrect output. Here's my below query:

n.CloudInstance.DisplayName AS Nodename
,n.CloudInstance.Region AS CloudInstance_Region
,n.CloudInstance.SubnetId AS CloudInstance_SubnetId
,AI.Resourcegroup as ResourceGroup
,round((TotalMemory/1024/1024/1024),1) as [RAM] 

FROM Orion.Nodes n 
Join Orion.Cloud.Azure.Instances AI 

If I put a where condition of n.IPAddress like 10.100.% the output gives me as total of 50 nodes.

But if I execute the query from table Orion.Nodes where IPAddress like 10.100.%, total nodes are 70. The reason behind this difference indicates that those 20 nodes have NULL values in NodeID column under Cloud.Azure.Instances table.

Can anyone please help me with getting the correct output?

Thanks in advance.

  • Hi,

    Not having an Azure instance, verify that Azure table does have a NodeID column that you can link to.
    For example, if the Azure table has a NodeID field, adjust your join as follows:

    Join Orion.Cloud.Azure.Instances AI on n.NodeID=AI.NodeID