if (row.TryGetValue(IdColumnName, out var idValue))
{
// Best effort on resource id piping
rowObject.Properties.Add(new PSNoteProperty(
name: ResourceIdColumnName,
value: idValue));
}
Impact
Using Azure Functions orchestration to query ARG and get a list of resource ids to take action on, sending each of those resource ids to an activity function to process. The way Azure Functions orchestration works is that the runtime serializes the object (the full ARG query results) to Azure Storage tables then deserializes back from storage as it processes them. This can happen thousands of times for a single processing run.
With the duplicated ResourceId property in the Search-AzGraph results, this is effectively doubling the size of the object that has to be serialized to and from storage, causing significant impacts on storage consumption and throttling, network IO, serialization processing time, etc.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @chiragg4u.
Issue Details
## Description
If an ARG query projects the 'id' field in the response, then Search-AzGraph adds a duplicate ResourceId property to the returned object.
## Steps to reproduce
```powershell
PS C:\Users\x>> (Search-AzGraph -Query "resources | project id" -Subscription $Subscriptions).data[0] | fl
id : /subscriptions/1234569a5-bb15-47c4-939c-4b66d5a7de05/resourceGroups/DefaultResourceGroup-CQ/providers/Microsoft.OperationalInsights/workspaces/DefaultWorkspace-1234569a5-bb15-47c4-939c-4b66d5a7de05-CQ
ResourceId : /subscriptions/1234569a5-bb15-47c4-939c-4b66d5a7de05/resourceGroups/DefaultResourceGroup-CQ/providers/Microsoft.OperationalInsights/workspaces/DefaultWorkspace-1234569a5-bb15-47c4-939c-4b66d5a7de05-CQ
```
This is happening in https://github.com/Azure/azure-powershell/blob/main/src/ResourceGraph/ResourceGraph/Utilities/ResultExtensions.cs
```
if (row.TryGetValue(IdColumnName, out var idValue))
{
// Best effort on resource id piping
rowObject.Properties.Add(new PSNoteProperty(
name: ResourceIdColumnName,
value: idValue));
}
```
## Impact
Using Azure Functions orchestration to query ARG and get a list of resource ids to take action on, sending each of those resource ids to an activity function to process. The way Azure Functions orchestration works is that the runtime serializes the object (the full ARG query results) to Azure Storage tables then deserializes back from storage as it processes them. This can happen thousands of times for a single processing run.
With the duplicated ResourceId property in the Search-AzGraph results, this is effectively doubling the size of the object that has to be serialized to and from storage, causing significant impacts on storage consumption and throttling, network IO, serialization processing time, etc.
Description
If an ARG query projects the 'id' field in the response, then Search-AzGraph adds a duplicate ResourceId property to the returned object.
Steps to reproduce
This is happening in https://github.com/Azure/azure-powershell/blob/main/src/ResourceGraph/ResourceGraph/Utilities/ResultExtensions.cs
Impact
Using Azure Functions orchestration to query ARG and get a list of resource ids to take action on, sending each of those resource ids to an activity function to process. The way Azure Functions orchestration works is that the runtime serializes the object (the full ARG query results) to Azure Storage tables then deserializes back from storage as it processes them. This can happen thousands of times for a single processing run.
With the duplicated ResourceId property in the Search-AzGraph results, this is effectively doubling the size of the object that has to be serialized to and from storage, causing significant impacts on storage consumption and throttling, network IO, serialization processing time, etc.