Logic Apps - Issue Passing Entity from Sentinel Connector to PowerShell Runbook Parameter

%3CLINGO-SUB%20id%3D%22lingo-sub-1023671%22%20slang%3D%22en-US%22%3ELogic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1023671%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20previously%20created%20some%20basic%20Logic%20Apps%20that%20would%20generate%20whenever%20an%20Azure%20Monitor%20(Log%20Analytics)%20alert%20was%20triggered%20and%20would%20then%20take%20the%20host%20name%20and%20IP%20address%20(depending%20on%20the%20use%20cases%20it%20was%20one%20or%20both)%20and%20pass%20those%20values%20generated%20from%20the%20alert%20into%20a%20%22Create%20Job%22%20event%20for%20Automation%20Account%20Logic%20Apps%20connector.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20move%20these%20playbooks%20into%20Sentinel%20leveraging%20the%20Sentinel%20Connector%20to%20get%20the%20data%20generated%20from%20the%20alert%2C%20grab%20the%20specific%20entities%20(in%20the%20case%20a%20HostName%2C%20IP%20or%20combination%20of%20both)%20and%20then%20pass%20those%20entities%20into%20the%20runbook%20parameters.%20I%20set%20up%20the%20Logic%20App%20as%20such%2C%20however%2C%20I'm%20running%20into%20an%20error%20(attached%20screenshot)%20stating%20the%20input%20value%20was%20not%20a%20JSON%20object.%20Is%20there%20something%20I%20am%20missing%20from%20the%20Sentinel%20connector%20generating%20the%20results%20and%20passing%20that%20entity%20on%3F%20Does%20it%20need%20to%20be%20converted%20into%20a%20JSON%20object%20after%20getting%20the%20entities%2C%20and%20if%20so%2C%20how%20would%20I%20go%20about%20doing%20that%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3ESean%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1023968%22%20slang%3D%22en-US%22%3ERe%3A%20Logic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1023968%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46875%22%20target%3D%22_blank%22%3E%40Gary%20Bushey%3C%2FA%3E%2C%26nbsp%3Bwill%20try%20that%20out%20and%20let%20you%20know%20the%20results.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1024139%22%20slang%3D%22en-US%22%3ERe%3A%20Logic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1024139%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46875%22%20target%3D%22_blank%22%3E%40Gary%20Bushey%3C%2FA%3E%26nbsp%3BThanks%20again%20for%20the%20suggestion%2C%20unfortunately%20it's%20still%20running%20into%20the%20same%20issue.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1024397%22%20slang%3D%22en-US%22%3ERe%3A%20Logic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1024397%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F113720%22%20target%3D%22_blank%22%3E%40Sean%20Hecht%3C%2FA%3E%26nbsp%3BI%20had%20a%20response%20come%20back%20that%20was%20throwing%20a%20JSON%20Formatting%20error%20and%20it%20went%20away%20when%20I%20completely%20rebuilt%20my%20workbook%20from%20scratch.%26nbsp%3B%20Not%20sure%20if%20that%20is%20how%20you%20built%20this%20one%20or%20not.%26nbsp%3B%20Hope%20it%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1025246%22%20slang%3D%22en-US%22%3ERe%3A%20Logic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1025246%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46875%22%20target%3D%22_blank%22%3E%40Gary%20Bushey%3C%2FA%3E%26nbsp%3BThanks%20for%20the%20heads%20up%20there%20as%20well.%20Went%20and%20re-created%20the%20entire%20flow%20and%20still%20hitting%20those%20same%20errors%2C%20at%20this%20point%20not%20entirely%20sure%20what%20the%20issue%20is.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20again.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1028796%22%20slang%3D%22en-US%22%3ERe%3A%20Logic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1028796%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F113720%22%20target%3D%22_blank%22%3E%40Sean%20Hecht%3C%2FA%3E%26nbsp%3BThe%20only%20other%20thing%20I%20can%20suggest%20is%20writing%20out%20the%20values%20into%20a%20Team%20message%20to%20see%20if%20there%20is%20something%20wrong%20with%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1073838%22%20slang%3D%22en-US%22%3ERe%3A%20Logic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1073838%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46875%22%20target%3D%22_blank%22%3E%40Gary%20Bushey%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F113720%22%20target%3D%22_blank%22%3E%40Sean%20Hecht%3C%2FA%3E%26nbsp%3B%20There%20have%20been%20an%20error%20in%20a%20backend%20issue%20where%20entities%20weren't%20listed%20in%20the%20incidents%20making%20the%20log%20apps%20using%20entities%20not%20working.%20This%20was%20solved%20sometime%20early%20half%20of%20december.%20Now%20the%20entities%20shows%20up%20in%20incidents%20but%20I'm%20still%20getting%20errors%20with%20my%20logic%20apps%20using%20entities%2C%20not%20quite%20the%20same%20ones%20though.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20looking%20for%20accounts%20as%20entities%20and%20using%20%22Alert%20-%20Get%20Accounts%20(Preview)%20and%20listing%20the%20entities%20using%20the%20dynamic%20content%20just%20as%20in%20%22%3CSPAN%3EDocument%20preview%20of%20Logic%20App%20Config%201%20of%202.png%22%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%22Message%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22The%20request%20entity's%20media%20type%20'text%2Fplain'%20is%20not%20supported%20for%20this%20resource.%5Cr%5CnclientRequestId%3A%206979....%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ESeems%20like%20the%20same%20issue%20or%20am%20I%20missing%20something%3F%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1073979%22%20slang%3D%22en-US%22%3ERe%3A%20Logic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1073979%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412474%22%20target%3D%22_blank%22%3E%40OskarEnfo%3C%2FA%3E%26nbsp%3BI%20have%20not%20run%20into%20this%20issue%20before.%26nbsp%3B%20There%20may%20be%20some%20issue%20with%20how%20your%20Entity%20was%20stored%20before%20the%20bug%20was%20fixed.%26nbsp%3B%20You%20will%20probably%20need%20to%20open%20a%20ticket%20with%20MS%20to%20get%20this%20resolved.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20Playbook%20that%20I%20run%20that%20looks%20at%20all%20the%20Entities%20and%20it%20works%20just%20fine%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1076240%22%20slang%3D%22en-US%22%3ERe%3A%20Logic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1076240%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412474%22%20target%3D%22_blank%22%3E%40OskarEnfo%3C%2FA%3E%26nbsp%3BI%20modified%20my%20Playbook%20to%20do%20what%20you%20were%20doing%20and%20it%20ran%20fine%20without%20any%20errors.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1081461%22%20slang%3D%22en-US%22%3ERe%3A%20Logic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1081461%22%20slang%3D%22en-US%22%3EBuilding%20a%20new%20workbook%20from%20scratch%20worked.%20It's%20identical%20but%20gives%20a%20different%20result..or%20was%2C%20I%20added%20stuff%20once%20it%20worked.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1023794%22%20slang%3D%22en-US%22%3ERe%3A%20Logic%20Apps%20-%20Issue%20Passing%20Entity%20from%20Sentinel%20Connector%20to%20PowerShell%20Runbook%20Parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1023794%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F113720%22%20target%3D%22_blank%22%3E%40Sean%20Hecht%3C%2FA%3E%26nbsp%3BIt%20may%20be%20that%20you%20need%20to%20load%20the%20Incident%20between%20the%20trigger%20and%20the%20Get%20hosts%20alert%20and%20use%20the%20Entites%20from%20the%20Incident%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi All,

 

I previously created some basic Logic Apps that would generate whenever an Azure Monitor (Log Analytics) alert was triggered and would then take the host name and IP address (depending on the use cases it was one or both) and pass those values generated from the alert into a "Create Job" event for Automation Account Logic Apps connector. 

 

I want to move these playbooks into Sentinel leveraging the Sentinel Connector to get the data generated from the alert, grab the specific entities (in the case a HostName, IP or combination of both) and then pass those entities into the runbook parameters. I set up the Logic App as such, however, I'm running into an error (attached screenshot) stating the input value was not a JSON object. Is there something I am missing from the Sentinel connector generating the results and passing that entity on? Does it need to be converted into a JSON object after getting the entities, and if so, how would I go about doing that?

 

Thanks,

Sean

10 Replies

@SH30 It may be that you need to load the Incident between the trigger and the Get hosts alert and use the Entites from the Incident

Thanks @Gary Bushey, will try that out and let you know the results.

@Gary Bushey Thanks again for the suggestion, unfortunately it's still running into the same issue.

@SH30 I had a response come back that was throwing a JSON Formatting error and it went away when I completely rebuilt my workbook from scratch.  Not sure if that is how you built this one or not.  Hope it helps.

@Gary Bushey Thanks for the heads up there as well. Went and re-created the entire flow and still hitting those same errors, at this point not entirely sure what the issue is.

 

Thanks again.

@SH30 The only other thing I can suggest is writing out the values into a Team message to see if there is something wrong with it.

 

@Gary Bushey @SH30  There have been an error in a backend issue where entities weren't listed in the incidents making the log apps using entities not working. This was solved sometime early half of december. Now the entities shows up in incidents but I'm still getting errors with my logic apps using entities, not quite the same ones though. 

 

I'm looking for accounts as entities and using "Alert - Get Accounts (Preview) and listing the entities using the dynamic content just as in "Document preview of Logic App Config 1 of 2.png"

{
"Message": "The request entity's media type 'text/plain' is not supported for this resource.\r\nclientRequestId: 6979...."
}
 
Seems like the same issue or am I missing something?

@OskarEnfo I have not run into this issue before.  There may be some issue with how your Entity was stored before the bug was fixed.  You will probably need to open a ticket with MS to get this resolved.

 

I have a Playbook that I run that looks at all the Entities and it works just fine

@OskarEnfo I modified my Playbook to do what you were doing and it ran fine without any errors. 

Building a new workbook from scratch worked. It's identical but gives a different result..or was, I added stuff once it worked.