invoke azure blockchain workbench rest api from azure logic app with oauth

%3CLINGO-SUB%20id%3D%22lingo-sub-1220528%22%20slang%3D%22en-US%22%3Einvoke%20azure%20blockchain%20workbench%20rest%20api%20from%20azure%20logic%20app%20with%20oauth%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1220528%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22votecell%20post-layout--left%22%3E%3CDIV%20class%3D%22js-voting-container%20grid%20fd-column%20ai-stretch%20gs4%20fc-black-200%22%3E%3CDIV%20class%3D%22js-vote-count%20grid--cell%20fc-black-500%20fs-title%20grid%20fd-column%20ai-center%22%3E0%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22postcell%20post-layout--right%22%3E%3CDIV%20class%3D%22post-text%22%3E%3CP%3EI%20am%20using%20Azure%20Blockchain%20workbench.%20One%20smart%20contract%20is%20deployed%20on%20Azure%20Blockchain%20workbench.%20I%20can%20do%20everything%20from%20workbench%20front%20end.%20But%20I%20want%20to%20integrate%20Azure%20Blockchain%20workbench%20backend%20(%20API%20part%20)%20with%20Azure%20logic%20apps.%20In%20Azure%20Blockchain%20workbench%20backend%20(%20API%20)%20there%20is%20POST%20api%20to%20enter%20data%20into%20smart%20contract.%20I%20want%20to%20invoke%20that%20API%20endpoint%20from%20Azure%20logic%20App.%20My%20logic%20app%20is%20like%20when%20a%20row%20is%20added%20to%20MSSQL%20database%20table%20it%20will%20trigger%20an%20action%20which%20will%20invoke%20POST%20api%20of%20Azure%20Blockchain%20workbench.%20Backend%20of%20Azure%20blockchain%20workbench%20is%20secured%20with%20Azure%20AD%20oauth.%20Currently%2C%20I%20am%20passing%20raw%20Bearer%20token%20in%20Azure%20logic%20apps%20by%20copying%20it%20from%20Inspect%20elements%20of%20browser.%20And%20it%20is%20working%20fine%20with%20that.%20But%20I%20want%20to%20make%20token%20dynamic%20because%20every%20time%20when%20token%20expires%20I%20have%20to%20copy%20and%20paste%20it%20again%20from%20browser%20to%20Azure%20logic%20app%20to%20make%20it%20work.%20I%20have%20confusion%20with%20Azure%20AD%20oauth.%20How%20to%20authenticate%20particular%20in%20Azure%20AD%20oauth%20and%20make%20API%20request%20with%20that%20user's%20auth%20token%20%3F%20If%20that%20is%20not%20possible%20with%20logic%20app%20how%20to%20generate%20auth%20token%20of%20particular%20user%20%3F%20(%20user%20I%20want%20to%20authenticate%20is%20registered%20in%20my%20Azure%20AD%20)%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1356369%22%20slang%3D%22en-US%22%3ERe%3A%20invoke%20azure%20blockchain%20workbench%20rest%20api%20from%20azure%20logic%20app%20with%20oauth%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1356369%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F578582%22%20target%3D%22_blank%22%3E%40hansrajrami%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20logic%20app%20you%20will%20be%20able%20to%20get%20http%20request%20and%20also%20can%20generate%20token%20from%20request%20%2Cplease%20refer%20url%26nbsp%3B%20.%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Flogic-apps%2Flogic-apps-securing-a-logic-app%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Flogic-apps%2Flogic-apps-securing-a-logic-app%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20insert%20data%20into%20SQL%20or%20Mysql%20database%20you%20may%20use%20ethereum%20smart%20contract%20connector%20to%20execute%20any%20function%20and%20after%20getting%20response%20trigger%20action%20to%20save%20data%20into%20SQL%20database%20.%20please%20refer%20below%20link%20may%20be%20helpful.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fasifwaquar.com%2Fpublish-logic-apps-and-flow-data-to-sql-database-in-azure-blockchain-service%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fasifwaquar.com%2Fpublish-logic-apps-and-flow-data-to-sql-database-in-azure-blockchain-service%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethank%20you%3C%2FP%3E%3CP%3EAsif%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor
0

I am using Azure Blockchain workbench. One smart contract is deployed on Azure Blockchain workbench. I can do everything from workbench front end. But I want to integrate Azure Blockchain workbench backend ( API part ) with Azure logic apps. In Azure Blockchain workbench backend ( API ) there is POST api to enter data into smart contract. I want to invoke that API endpoint from Azure logic App. My logic app is like when a row is added to MSSQL database table it will trigger an action which will invoke POST api of Azure Blockchain workbench. Backend of Azure blockchain workbench is secured with Azure AD oauth. Currently, I am passing raw Bearer token in Azure logic apps by copying it from Inspect elements of browser. And it is working fine with that. But I want to make token dynamic because every time when token expires I have to copy and paste it again from browser to Azure logic app to make it work. I have confusion with Azure AD oauth. How to authenticate particular in Azure AD oauth and make API request with that user's auth token ? If that is not possible with logic app how to generate auth token of particular user ? ( user I want to authenticate is registered in my Azure AD )

1 Reply

Hi @hansrajrami ,

 

In logic app you will be able to get http request and also can generate token from request ,please refer url  .https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-securing-a-logic-app

 

To insert data into SQL or Mysql database you may use ethereum smart contract connector to execute any function and after getting response trigger action to save data into SQL database . please refer below link may be helpful.

http://asifwaquar.com/publish-logic-apps-and-flow-data-to-sql-database-in-azure-blockchain-service/

 

thank you

Asif