Skip to content

Instantly share code, notes, and snippets.

@stefanstranger
Created March 30, 2024 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanstranger/9681324a42b297a6749cd1505e62af94 to your computer and use it in GitHub Desktop.
Save stefanstranger/9681324a42b297a6749cd1505e62af94 to your computer and use it in GitHub Desktop.
Issue 26 result

Azure Logic App Documentation - Issue26

Introduction

This document describes the Azure Logic App Workflow Issue26 in the demo-rg resource group in the Visual Studio Enterprise subscription.

This document is programmatically generated using a PowerShell script.

Date: 2024-03-30 15:09:52

Logic App Workflow Diagram

graph TB
    Trigger
    subgraph sap_service_invoke
    direction TB
        Invoke_sap_webservice
        Parse_sap_webservice_response_body
    end
    subgraph sap_service_invoke_failed
    direction TB
        update_process_failed
    end
    subgraph sap_service_invoke_succeeded
    direction TB
        update_process_succeeded
    end
    Initialize_processid --> Get_apikey
    Get_apikey --> Initialize_apikey
    init_uri --> Initialize_processid
    Initialize_apikey --> async_response
    init_baseuri --> init_uri
    Initialize_apikey --> sap_service_invoke
    sap_service_invoke --> Invoke_sap_webservice
    Invoke_sap_webservice --> Parse_sap_webservice_response_body
    sap_service_invoke --> sap_service_invoke_failed
    sap_service_invoke_failed --> update_process_failed
    sap_service_invoke_failed --> sap_service_invoke_succeeded
    sap_service_invoke_succeeded --> update_process_succeeded
    Trigger --> init_baseuri

Logic App Workflow Actions

This section shows an overview of Logic App Workflow actions and their dependencies.

Actions

ActionName Type RunAfter Inputs
init_baseuri InitializeVariable
{
"variables": [
{
"name": "baseUri",
"type": "String",
"value": "https://sapservices/api/"
}
]
}
init_uri InitializeVariable init_baseuri
{
"variables": [
{
"name": "uri",
"type": "String",
"value": "@{variables('baseUri')}@{triggerBody()?['operationName']}"
}
]
}
Initialize_processid InitializeVariable init_uri
{
"variables": [
{
"name": "processid",
"type": "String",
"value": "@triggerBody()['processid']"
}
]
}
Get_apikey ApiConnection Initialize_processid
{
"host": {
"connection": {
"name": "@parameters('$connections')['keyvault']['connectionId']"
}
},
"method": "get",
"path": "/secrets/@{encodeURIComponent('mykey')}/value"
}
Initialize_apikey InitializeVariable Get_apikey
{
"variables": [
{
"name": "apikey",
"type": "string",
"value": "@body('Get_apikey')?['value']"
}
]
}
async_response Response Initialize_apikey
{
"body": {},
"schema": {
"properties": {},
"type": "object"
},
"statusCode": 200
}
sap_service_invoke Scope Initialize_apikey null
Invoke_sap_webservice Http sap_service_invoke
{
"body": {
"AccountNumber": "@{triggerBody()?['AccountNumber']}",
"EntityId": "@{triggerBody()?['EntityId']}",
"EntityLogicalName": "@{triggerBody()?['EntityLogicalName']}",
"QuoteId": "@{triggerBody()?['QuoteId']}",
"SalesOrg": "@{triggerBody()?['SalesOrg']}",
"userId": "@{triggerBody()?['userId']}"
},
"headers": {
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "@variables('apikey')",
"Ocp-Apim-Trace": "true"
},
"method": "POST",
"retryPolicy": {
"type": "none"
},
"uri": "@variables('uri')"
}
Parse_sap_webservice_response_body ParseJson Invoke_sap_webservice
{
"content": "@body('Invoke_sap_webservice')",
"schema": {
"properties": {
"ErrorMessage": {},
"HasOrderBlock": {
"type": "boolean"
},
"Success": {
"type": "boolean"
}
},
"type": "object"
}
}
sap_service_invoke_failed Scope sap_service_invoke null
update_process_failed ApiConnection sap_service_invoke_failed
{
"body": {
"_ownerid_type": "",
"test_log": "@{body('Parse_sap_webservice_response_body')?['ErrorMessage']}",
"test_processstatus": 135790003
},
"host": {
"connection": {
"name": "@parameters('$connections')['commondataservice_1']['connectionId']"
}
},
"method": "patch",
"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('democrm'))}/tables/@{encodeURIComponent(encodeURIComponent('test_longrunningprocesses'))}/items/@{encodeURIComponent(encodeURIComponent(variables('processid')))}"
}
sap_service_invoke_succeeded Scope sap_service_invoke_failed null
update_process_succeeded ApiConnection sap_service_invoke_succeeded
{
"body": {
"_ownerid_type": "",
"test_processstatus": 135790002,
"test_response": "@{body('Invoke_sap_webservice')}"
},
"host": {
"connection": {
"name": "@parameters('$connections')['commondataservice_1']['connectionId']"
}
},
"method": "patch",
"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('democrm'))}/tables/@{encodeURIComponent(encodeURIComponent('test_longrunningprocesses'))}/items/@{encodeURIComponent(encodeURIComponent(variables('processid')))}"
}

Logic App Connections

This section shows an overview of Logic App Workflow connections.

Connections

ConnectionName ConnectionId ConnectionProperties
commondataservice /subscriptions/12378888-ce3e-456b-92c9-54e214015111/resourceGroups/test/providers/Microsoft.Web/connections/commondataservice null
keyvault /subscriptions/12378888-ce3e-456b-92c9-54e214015111/resourceGroups/test/providers/Microsoft.Web/connections/keyvault null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment