azure-logic-apps

Azure Logic App Function call for non json body


I am Configuring logic app in one of compose action i have below output but its not json format from this output i need AlertID value alone since its not json format functions are showing invalid format error , can some one help me to fix this

:azure: :alert: 
*Non-Prod Alert: RuleCpupercetange*
*Severity*: Sev4
*Timestamp*: 2024-10-10T17:55:18.5144302Z 
*Alert Id*: ```/subscriptions/32476574-bf58-4703-96d9-4378327845/providers/Microsoft.AlertsManagement/alerts/629bd98a-f9b5-c79a-75b1-b807b48d0002```
Click here to find the code 
*****************************************************
*Affected resource: W008ssaltmost* 
*Resource modified by:unknown@gmail.com*
*****************************************************
*Select a response:*, with interactive elements


Solution

  • This expression will do it for you ...

    split(variables('Text'), '```')[1]
    

    ... with a huge caveat and that is that the data will stay as is and not deviate from what you've provided.

    Replace variables('Text') with whatever you're supplying to the Compose step.