%3CLINGO-SUB%20id%3D%22lingo-sub-1445017%22%20slang%3D%22en-US%22%3EAccess%20Azure%20Functions%20from%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1445017%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22lia-message-body-content%22%3E%0A%3CP%3EIn%20this%20article%2C%20I%20will%20be%20describing%20you%20the%20steps%20on%20how%20to%20access%20the%20Azure%20Functions%20that%20is%20configured%20to%20not%20allow%20anonymous%20access%20from%20Logic%20App%20through%20AD%20authentication.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPrerequisites%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-functions%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Functions%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Flogic-apps%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Logic%20App%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fdevelop%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EApp%20Registration%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20quick%20intro%2Fstart%20on%20Registering%20App%20follow%20this%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fdevelop%2Fquickstart-register-app%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Elink%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlso%20make%20sure%20you%20have%20sufficient%20access%20(Like%20%22Contributor%22%20rights%20in%20Azure%20Resource%20Group%20also%20%22Owner%22%20rights%20at%20Resource%20level)%20to%20create%20all%20the%20above%20azure%20artifacts%3C%2FP%3E%0A%3CP%3EFirst%20let%20us%20begin%20by%20creating%20Azure%20functions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGo%20to%20Azure%20Portal%20and%20create%20a%20resource.%20Select%20Azure%20Functions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECreate%20the%20Function%20App%20with%20all%20necessary%20details%20from%20dropdown.%3C%2FP%3E%0A%3CP%3ESelect%20the%20Storage%20account%20in%20the%20same%20region%20also%20choose%20the%20plan%20type%20appropriately%20based%20on%20the%20usage%2Fbudget.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196944i6C39C3B298CEA1D3%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%22FirstScreen.PNG%22%20title%3D%22FirstScreen.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFinally%20validate%20the%20properties%20and%20create%20the%20Function%20App.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20270px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196950i6E764FCCDC837184%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%22ThirdScreen.PNG%22%20title%3D%22ThirdScreen.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAdd%20a%20function%20and%20choose%20the%20Template%20(I%20have%20chosen%20Http%20trigger%3A%20which%20gets%20triggered%20manually%20when%20you%20try%20to%20access%20from%20any%20client%20application)%20and%20finally%20create%20Function.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196951iC1EED16B8EA3103E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%22FourthScreen.PNG%22%20title%3D%22FourthScreen.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorvinaykrish_3%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196953iA5D3910CA9F4834B%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%22FifthScreen.PNG%22%20title%3D%22FifthScreen.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196952i523366276FB4FFBD%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%22SixScreen.PNG%22%20title%3D%22SixScreen.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you%20have%20created%20a%20sample%20application%2C%20navigate%20to%20the%20Azure%20Function-%26gt%3B%20%22Code%20%2B%20Test%22.%3C%2FP%3E%0A%3CP%3EThe%20below%20sample%20template%20accepts%20the%20Json%20request%20and%20sends%20response%20in%20string.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196954i72CE67B63522E252%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%227.PNG%22%20title%3D%227.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20test%20it%20out%20by%20using%20%22Test%2FRun%22%20with%20sample%20Input%20and%20click%20Run%3A%3C%2FP%3E%0A%3CP%3E%7B%3C%2FP%3E%0A%3CP%3E%22name%22%3A%22John%22%3C%2FP%3E%0A%3CP%3E%7D%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196958i2A887B2883A3D3D6%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%228.PNG%22%20title%3D%228.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorvinaykrish_7%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3EThe%20response%20you%20would%20receive%26nbsp%3B%20is%20%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196961i64D861F5F8F2D543%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%229.PNG%22%20title%3D%229.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20can%20be%20tested%20even%20through%20the%20Postman.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196962i292A0465B7B6DB0C%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2210.PNG%22%20title%3D%2210.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%2C%20let's%20to%20restrict%20Azure%20functions%20to%20not%20allow%20with%20anonymous%20user%20and%20give%20a%20try%20to%20access%20the%20Azure%20Functions%20through%20Postman.%3C%2FP%3E%0A%3CP%3EGoto%20%22Authentication%20and%20Authorization%22under%20Function%20App%20blade%20then%20turn%20on%20%22App%20Service%20Authentication%22%20under%20%22Access%20Restrictions%22%20section.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlso%20choose%20%22Login%20with%20Azure%20Active%20Directory%22%20under%20%22Action%20to%20take%20when%20request%20is%20not%20authenticated%20%22and%20finally%20Save.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196984i70D993E32BE0B18A%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2211.PNG%22%20title%3D%2211.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorvinaykrish_10%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3EThis%20particular%20setting%20will%20not%20allow%20the%20Azure%20function%20to%20respond%20unless%20it%20is%20authenticated%20through%20Azure%20Active%20Directory.%3C%2FP%3E%0A%3CP%3EPostman%20will%20throw%20an%20error%20with%20code%20401%20as%20shown%20below.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196964i07AF6EE99455D15B%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%222.PNG%22%20title%3D%222.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorvinaykrish_11%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3ENow%20this%20function%20can%20be%20accessed%20through%20AD%20Authentication.%20To%20authenticate%20we%20must%20first%20register%20the%20Application%20using%20App%20registration.%3C%2FP%3E%0A%3CP%3EWe%20can%20do%20this%20App%20registration%20directly%20creating%20the%20Azure%20AD%20App%20via%20Azure%20Function%20%22Authentication%20%2F%20Authorization%22%20blade.%3C%2FP%3E%0A%3CP%3EFor%20that%20we%20have%20to%20choose%20%22Azure%20Active%20Directory%22%20option%20in%20%22Authentication%20%2F%20Authorization%22%20blade%20and%20finally%20create%20a%20new%20AD%20App%20by%20providing%20the%20appropriate%20App%20name%20in%20Create%20App%20field%20as%20shown%20below.%3C%2FP%3E%0A%3CP%3EThese%20options%20can%20be%20viewed%20under%20Express%20mode%20as%20shown%20in%20the%20below%20screenshot.%3C%2FP%3E%0A%3CP%3EExpress%20mode%20allows%20user%20to%20create%20an%20AD%20Application%20or%20select%20an%20existing%20AD%20application%20in%20your%20current%20Active%20Directory.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196965i276D854D39D32D83%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%221.PNG%22%20title%3D%221.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EHowever%2C%20I%20recommend%20you%20to%20create%20App%20Registration%20manually%20.%20If%20you%20are%20building%20an%20application%20for%20external%20users%20that%20will%20be%20distributed%20by%20Microsoft%2C%20you%20must%20register%20as%20a%20first%20party%20application%20to%20meet%20all%20security%2C%20privacy%2C%20and%20compliance%20policies.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%20us%20create%20App%20Registration.%3C%2FP%3E%0A%3CP%3EGo%20to%20App%20registration%20and%20create%20new.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196966i12BDADF24F52C94E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2212.PNG%22%20title%3D%2212.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorvinaykrish_13%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3ECreate%20Secret%20by%20choosing%20%22Certificates%20%26amp%3B%20Secrets%22%20in%20the%20left%20pane%20of%20the%20App%20registration.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196991i5DEC09BBD88E3016%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2213.PNG%22%20title%3D%2213.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorvinaykrish_14%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3ECopy%20the%20secret%20and%20keep%20it%20ready%20to%20use%20it%20in%20Logic%20App.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196986i1A5F9C1E610B8BE8%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2214.PNG%22%20title%3D%2214.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorvinaykrish_15%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3EAlso%2C%20please%20copy%20the%20Client%20ID%20%2C%20Tenant%20ID%20and%20keep%20it%20ready%20to%20use%20it%20in%20Logic%20App%20later.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196987i1BCD2AD5D4793FDC%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2215.PNG%22%20title%3D%2215.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20we%20will%20have%20to%20choose%20the%20particular%20AD%20Application%20in%20Azure%20functions%20via%20which%20an%20user%20can%20access.%3C%2FP%3E%0A%3CP%3EGoto%20-%26gt%3B%20Azure%20Functions-%26gt%3B%20choose%20the%20Azure%20Function-%26gt%3B%20Select%20%22Authorization%20%2F%20Authentication%22%20-%26gt%3B%20choose%20%22Azure%20Active%20directory%22%20in%20the%20right%20pane.%3C%2FP%3E%0A%3CP%3ESelect%20already%20created%20AD%20App%20%22functionappaccess%22%20by%20verifying%20the%20Client%20ID%20and%20finally%26nbsp%3B%20%22OK%22%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorvinaykrish_17%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196973iFAA6F778DFF94D43%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2216.PNG%22%20title%3D%2216.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196972i921A302178771BEA%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2216-5.PNG%22%20title%3D%2216-5.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196974i6BB7AC7D0A51089F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2217.PNG%22%20title%3D%2217.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELater%20Save%20the%20Authentication%20%2F%20Authorization%20configuration.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20it%20is%20time%20to%20test%20the%20Authenticate%20with%20Secret%2C%20ClientID%20%2C%20TenantID%20in%20Logic%20apps.%3C%2FP%3E%0A%3CP%3ECreate%20a%20Logic%20App%20may%20be%20either%20with%20Recurrence%20Trigger%20or%20Manual%20Http%20Trigger.%3C%2FP%3E%0A%3CP%3ELater%20create%20Http%20action%20with%20TenantID%2C%20Client%20ID%20and%20the%20Secret.%3C%2FP%3E%0A%3CP%3EPlease%20note%20I%20have%20used%20ClientID%20for%20Audience%20.%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorvinaykrish_20%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20385px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196975iC582AB43E6EED9E9%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2218.PNG%22%20title%3D%2218.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EPlease%20give%20a%20try%20by%20running%20it%20manually.%3C%2FP%3E%0A%3CP%3EResult%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196977i90587CDD5BA2B5D8%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2219.PNG%22%20title%3D%2219.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196978i7706B38C2F128709%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2219-5.PNG%22%20title%3D%2219-5.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Azure%20Functions%20can%20also%20be%20reached%20by%20Azure%20Functions%20actions.%3C%2FP%3E%0A%3CP%3EAdd%20Azure%20Function%20action-%26gt%3B%26nbsp%3B%20Function-%26gt%3B%20Choose%20the%20action%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196992i3960BF2E307532E4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2220.PNG%22%20title%3D%2220.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EEnter%20appropriate%20TenantID%2C%20ClientID%20and%20Secret%20along%20with%20Audience.%3C%2FP%3E%0A%3CP%3EAlso%2C%20please%20note%20I%20have%20used%20ClientID%20for%20Audience.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196990i8552DFA970881063%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2221.PNG%22%20title%3D%2221.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EPlease%20give%20a%20manual%20run%20for%20testing.%3C%2FP%3E%0A%3CP%3EResult%20%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196981i2974F7E7D428A1AF%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2222.PNG%22%20title%3D%2222.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22lia-teaserTinyMceEditorvinaykrish_25%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196982i86897D590444CA6C%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20border%3D%220%22%20alt%3D%2222-5.PNG%22%20title%3D%2222-5.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20going%20through%20the%20article.%20Hope%20you%20enjoyed%20it!%3C%2FP%3E%0A%3CP%3EPlease%20leave%20your%20comments%2Fqueries%20in%20the%20comments%20section.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1445017%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22lia-align-center%22%3EAccess%20Azure%20Function%20App%20from%20Logic%20App%20using%20AD%20Authentication%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22teaser.png%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197001iD61E8966AF108D0D%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20title%3D%22teaser.png%22%20alt%3D%22teaser.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1445017%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%20Azure%20Functions%20from%20Logic%20App%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1446971%22%20slang%3D%22en-US%22%3ERe%3A%20Access%20Azure%20Functions%20from%20Logic%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1446971%22%20slang%3D%22en-US%22%3E%3CP%3ENice%20article%20Vinay.%20Quite%20informative.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

In this article, I will be describing you the steps on how to access the Azure Functions that is configured to not allow anonymous access from Logic App through AD authentication.

 

Prerequisites:

  1. Azure Functions
  2. Azure Logic App 
  3. App Registration

 

For quick intro/start on Registering App follow this link.

 

Also make sure you have sufficient access (Like "Contributor" rights in Azure Resource Group also "Owner" rights at Resource level) to create all the above azure artifacts

First let us begin by creating Azure functions.

 

Go to Azure Portal and create a resource. Select Azure Functions.

 

Create the Function App with all necessary details from dropdown.

Select the Storage account in the same region also choose the plan type appropriately based on the usage/budget.

FirstScreen.PNG

Finally validate the properties and create the Function App.

ThirdScreen.PNG

Add a function and choose the Template (I have chosen Http trigger: which gets triggered manually when you try to access from any client application) and finally create Function.

 

FourthScreen.PNG

 

FifthScreen.PNG

SixScreen.PNG

 

Once you have created a sample application, navigate to the Azure Function-> "Code + Test".

The below sample template accepts the Json request and sends response in string.

7.PNG

 

You can test it out by using "Test/Run" with sample Input and click Run:

{

"name":"John"

}

8.PNG

 

The response you would receive  is :

 

9.PNG

 

This can be tested even through the Postman.

10.PNG

 

Now, let's to restrict Azure functions to not allow with anonymous user and give a try to access the Azure Functions through Postman.

Goto "Authentication and Authorization"under Function App blade then turn on "App Service Authentication" under "Access Restrictions" section.

 

Also choose "Login with Azure Active Directory" under "Action to take when request is not authenticated "and finally Save.

11.PNG

 

This particular setting will not allow the Azure function to respond unless it is authenticated through Azure Active Directory.

Postman will throw an error with code 401 as shown below.

2.PNG

 

Now this function can be accessed through AD Authentication. To authenticate we must first register the Application using App registration.

We can do this App registration directly creating the Azure AD App via Azure Function "Authentication / Authorization" blade.

For that we have to choose "Azure Active Directory" option in "Authentication / Authorization" blade and finally create a new AD App by providing the appropriate App name in Create App field as shown below.

These options can be viewed under Express mode as shown in the below screenshot.

Express mode allows user to create an AD Application or select an existing AD application in your current Active Directory.

 

1.PNG

However, I recommend you to create App Registration manually . If you are building an application for external users that will be distributed by Microsoft, you must register as a first party application to meet all security, privacy, and compliance policies.

 

Let us create App Registration.

Go to App registration and create new.

 

12.PNG

 

Create Secret by choosing "Certificates & Secrets" in the left pane of the App registration.

13.PNG

 

Copy the secret and keep it ready to use it in Logic App.

 

14.PNG

 

Also, please copy the Client ID , Tenant ID and keep it ready to use it in Logic App later.

 

15.PNG

 

Now we will have to choose the particular AD Application in Azure functions via which an user can access.

Goto -> Azure Functions-> choose the Azure Function-> Select "Authorization / Authentication" -> choose "Azure Active directory" in the right pane.

Select already created AD App "functionappaccess" by verifying the Client ID and finally  "OK"

 

16.PNG

 

16-5.PNG

 

17.PNG

 

Later Save the Authentication / Authorization configuration.

 

Now it is time to test the Authenticate with Secret, ClientID , TenantID in Logic apps.

Create a Logic App may be either with Recurrence Trigger or Manual Http Trigger.

Later create Http action with TenantID, Client ID and the Secret.

Please note I have used ClientID for Audience .

 

18.PNG

Please give a try by running it manually.

Result:

 

19.PNG

 

19-5.PNG

 

The Azure Functions can also be reached by Azure Functions actions.

Add Azure Function action->  Function-> Choose the action

 

20.PNG

Enter appropriate TenantID, ClientID and Secret along with Audience.

Also, please note I have used ClientID for Audience.

 

21.PNG

Please give a manual run for testing.

Result :

22.PNG

 

22-5.PNG

 

Thanks for going through the article. Hope you enjoyed it!

Please leave your comments/queries in the comments section.

 

1 Comment
Senior Member

Nice article Vinay. Quite informative.