%3CLINGO-SUB%20id%3D%22lingo-sub-1456397%22%20slang%3D%22en-US%22%3ERe%3A%20APIM%20Policy%20to%20perform%20Azure%20Storage%20File%20Shares%20operations%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1456397%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20was%20Helpful...thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1456405%22%20slang%3D%22en-US%22%3ERe%3A%20APIM%20Policy%20to%20perform%20Azure%20Storage%20File%20Shares%20operations%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1456405%22%20slang%3D%22en-US%22%3E%3CP%3EGood%20one.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1442921%22%20slang%3D%22en-US%22%3EAPIM%20Policy%20to%20perform%20Azure%20Storage%20File%20Shares%20operations%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1442921%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EAPIM%20Policy%20to%20perform%20Azure%20Storage%20File%20Shares%20operations%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EWe%20can%20use%20APIM%20policy%20to%20perform%20operations%20like%20create%2C%20update%2C%20delete%20and%20get%20on%20Azure%20Storage%20File%20Shares.%20To%20do%20this%2C%20we%20need%20to%20insert%20an%20inbound%20policy%20to%20the%20API%20operation%20configurations%20in%20Design%20mode.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESteps%20to%20add%20inbound%20policy%20to%20create%20a%20file%20in%20File%20Shares%20%E2%80%93%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EGo%20to%20the%20API%20Management%20Service%2C%20select%20APIs%20from%20APIs%20blade.%20Then%20select%20any%20of%20your%20API%20from%20the%20ALL%20APIs%20list.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EThis%20will%20populate%20the%20related%20API%20Operations.%20Select%20POST%20(create%20Resource)%20from%20the%20API%20operations%20list%20like%20referred%20in%20the%20screenshot%20below-%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_0-1591362160880.png%22%20style%3D%22width%3A%20921px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196716i76A250847018ED49%2Fimage-dimensions%2F921x311%3Fv%3D1.0%22%20width%3D%22921%22%20height%3D%22311%22%20title%3D%22praskuma_0-1591362160880.png%22%20alt%3D%22praskuma_0-1591362160880.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3EClick%20on%20the%20%20sign%20to%20enter%20Edit%20mode%20and%20insert%20the%20new%20policy%20like%20in%20the%20below%20screenshot.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_1-1591362160888.png%22%20style%3D%22width%3A%20690px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196715i59E5F2608453F7DC%2Fimage-dimensions%2F690x306%3Fv%3D1.0%22%20width%3D%22690%22%20height%3D%22306%22%20title%3D%22praskuma_1-1591362160888.png%22%20alt%3D%22praskuma_1-1591362160888.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_2-1591362160898.png%22%20style%3D%22width%3A%20950px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196717i38A026E966D1556C%2Fimage-dimensions%2F950x362%3Fv%3D1.0%22%20width%3D%22950%22%20height%3D%22362%22%20title%3D%22praskuma_2-1591362160898.png%22%20alt%3D%22praskuma_2-1591362160898.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3ECopy%20the%20below%20policy%20definition%20and%20paste%20in%20between%20the%20%3CINBOUND%3E%3C%2FINBOUND%3E%20tags.%20Update%20the%20highlighted%20values%20with%20your%20Storage%20account%20details%20and%20save.%20Please%20make%20sure%20all%20the%20required%20headers%20are%20in%20the%20same%20format%20as%20below.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%3CINBOUND%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CBASE%20%2F%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C!--%20Initialize%20context%20variables%20with%20property%20values.%20--%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-VARIABLE%20name%3D%22storageAccount%22%20value%3D%22NameOfYourStorageAccount%22%3E%3C%2FSET-VARIABLE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-VARIABLE%20name%3D%22x-request-body%22%20value%3D%22%40(context.Request.Body.As%26lt%3Bstring%26gt%3B())%22%3E%3C%2FSET-VARIABLE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-VARIABLE%20name%3D%22x-request-body-length%22%20value%3D%22%40%7B%0A%0A%26nbsp%3Breturn%20(string)context.Request.Headers.GetValueOrDefault(%22%20content-length%3D%22%22%3E%3C%2FSET-VARIABLE%3E%0A%0A%26nbsp%3B%20%3CSEND-REQUEST%20mode%3D%22new%22%20response-variable-name%3D%22tokenstate%22%20timeout%3D%222%22%20ignore-error%3D%22true%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-URL%3E%40%7B%0A%0A%26nbsp%3Breturn%20string.Format(%22https%3A%2F%2F%7B0%7D.file.core.windows.net%2FNamOfYourFileShares%2FFileNamewithextension%3FSASToken%20%22%2C(string)context.Variables%5B%22storageAccount%22%5D)%3B%0A%0A%26nbsp%3B%7D%3C%2FSET-URL%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-METHOD%3EPUT%3C%2FSET-METHOD%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-type%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3Efile%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-file-permission%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3Einherit%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-file-attributes%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3Enone%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-file-creation-time%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3Enow%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-file-last-write-time%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3Enow%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-content-length%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E65336%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSEND-REQUEST%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FINBOUND%3E%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%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%20image-alt%3D%22praskuma_3-1591362160907.png%22%20style%3D%22width%3A%20779px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196720iAB3636DD2CC4BB05%2Fimage-dimensions%2F779x182%3Fv%3D1.0%22%20width%3D%22779%22%20height%3D%22182%22%20title%3D%22praskuma_3-1591362160907.png%22%20alt%3D%22praskuma_3-1591362160907.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%224%22%3E%0A%3CLI%3EAfter%20saving%20the%20policy%2C%20go%20to%20the%20Test%20tab%20of%20API.%20Select%20that%20updated%20API%20operation%20and%20click%20on%20send.%20If%20all%20the%20updated%20parameters%20are%20authenticated%2C%20you%20will%20receive%20200%20OK%20and%20the%20trace%20will%20show%20201%20(Created)%20response%20code.%3C%2FLI%3E%0A%3C%2FOL%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%20image-alt%3D%22praskuma_4-1591362160913.png%22%20style%3D%22width%3A%20713px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196718iC693001D0F927C6A%2Fimage-dimensions%2F713x336%3Fv%3D1.0%22%20width%3D%22713%22%20height%3D%22336%22%20title%3D%22praskuma_4-1591362160913.png%22%20alt%3D%22praskuma_4-1591362160913.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%20image-alt%3D%22praskuma_5-1591362160919.png%22%20style%3D%22width%3A%20711px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196719iF86C3D52E5FF97A5%2Fimage-dimensions%2F711x304%3Fv%3D1.0%22%20width%3D%22711%22%20height%3D%22304%22%20title%3D%22praskuma_5-1591362160919.png%22%20alt%3D%22praskuma_5-1591362160919.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%225%22%3E%0A%3CLI%3EThe%20new%20created%20file%20can%20be%20viewed%20in%20the%20File%20Shares%20%E2%80%93%3C%2FLI%3E%0A%3C%2FOL%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%20image-alt%3D%22praskuma_6-1591362160925.png%22%20style%3D%22width%3A%20705px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196721i62120D422B8CA860%2Fimage-dimensions%2F705x231%3Fv%3D1.0%22%20width%3D%22705%22%20height%3D%22231%22%20title%3D%22praskuma_6-1591362160925.png%22%20alt%3D%22praskuma_6-1591362160925.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%226%22%3E%0A%3CLI%3EIn%20case%2C%20we%20want%20to%20do%20the%20error%20handling%20we%20can%20add%20the%20on-error%20section%20to%20track%20the%20error%20responses%20as%20well.%20We%20need%20to%20add%20this%20block%20after%20outbound%20closing%20tag.%20This%20will%20give%20use%20information%20about%20the%20related%20errors.%20Reference%20link%20for%20APIM%20error%20handling-%20-ERR%3AREF-NOT-FOUND-%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-error-handling-policies%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-error-handling-policies%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%3CON-ERROR%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorSource%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Source)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorReason%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Reason)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorMessage%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Message)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorScope%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Scope)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorSection%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Section)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorPath%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Path)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorPolicyId%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.PolicyId)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorStatusCode%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.Response.StatusCode.ToString())%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CBASE%20%2F%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FON-ERROR%3E%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%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%20image-alt%3D%22praskuma_7-1591362160934.png%22%20style%3D%22width%3A%20713px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196722iDC7815864E3E0DD9%2Fimage-dimensions%2F713x335%3Fv%3D1.0%22%20width%3D%22713%22%20height%3D%22335%22%20title%3D%22praskuma_7-1591362160934.png%22%20alt%3D%22praskuma_7-1591362160934.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESimilarly%2C%20we%20can%20perform%20other%20operations%20like%20update%20and%20get%20by%20updating%20the%20required%20headers%20into%20the%20policy.%3C%2FP%3E%0A%3CP%3EReference%20link%20for%20File%20Share%20operation%20APIs%20-%20-ERR%3AREF-NOT-FOUND-%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Foperations-on-files%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Foperations-on-files%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1442921%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EAPIM%20Policy%20to%20perform%20Azure%20Storage%20File%20Shares%20operations%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWe%20can%20use%20APIM%20policy%20to%20perform%20operations%20like%20create%2C%20update%2C%20delete%20and%20get%20on%20Azure%20Storage%20File%20Shares.%20To%20do%20this%2C%20we%20need%20to%20insert%20an%20inbound%20policy%20to%20the%20API%20operation%20configurations%20in%20Design%20mode.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESteps%20to%20add%20inbound%20policy%20to%20create%20a%20file%20in%20File%20Shares%20%E2%80%93%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSTRONG%3EGo%20to%20the%20API%20Management%20Service%2C%20select%20APIs%20from%20APIs%20blade.%20Then%20select%20any%20of%20your%20API%20from%20the%20ALL%20APIs%20list.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSTRONG%3EThis%20will%20populate%20the%20related%20API%20Operations.%20Select%20POST%20(create%20Resource)%20from%20the%20API%20operations%20list%20like%20referred%20in%20the%20screenshot%20below-%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_0-1591362160880.png%22%20style%3D%22width%3A%20921px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196716i76A250847018ED49%2Fimage-dimensions%2F921x311%3Fv%3D1.0%22%20width%3D%22921%22%20height%3D%22311%22%20title%3D%22praskuma_0-1591362160880.png%22%20alt%3D%22praskuma_0-1591362160880.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3E%3CSTRONG%3EClick%20on%20the%20%20sign%20to%20enter%20Edit%20mode%20and%20insert%20the%20new%20policy%20like%20in%20the%20below%20screenshot.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_1-1591362160888.png%22%20style%3D%22width%3A%20690px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196715i59E5F2608453F7DC%2Fimage-dimensions%2F690x306%3Fv%3D1.0%22%20width%3D%22690%22%20height%3D%22306%22%20title%3D%22praskuma_1-1591362160888.png%22%20alt%3D%22praskuma_1-1591362160888.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_2-1591362160898.png%22%20style%3D%22width%3A%20950px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196717i38A026E966D1556C%2Fimage-dimensions%2F950x362%3Fv%3D1.0%22%20width%3D%22950%22%20height%3D%22362%22%20title%3D%22praskuma_2-1591362160898.png%22%20alt%3D%22praskuma_2-1591362160898.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3E%3CSTRONG%3ECopy%20the%20below%20policy%20definition%20and%20paste%20in%20between%20the%20%3CINBOUND%3E%3C%2FINBOUND%3E%20tags.%20Update%20the%20highlighted%20values%20with%20your%20Storage%20account%20details%20and%20save.%20Please%20make%20sure%20all%20the%20required%20headers%20are%20in%20the%20same%20format%20as%20below.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3Cpre%20class%3D%22lia-code-sample%20language-json%22%3E%3Ccode%3E%3CINBOUND%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CBASE%20%2F%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C!--%20Initialize%20context%20variables%20with%20property%20values.%20--%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-VARIABLE%20name%3D%22storageAccount%22%20value%3D%22NameOfYourStorageAccount%22%3E%3C%2FSET-VARIABLE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-VARIABLE%20name%3D%22x-request-body%22%20value%3D%22%40(context.Request.Body.As%26lt%3Bstring%26gt%3B())%22%3E%3C%2FSET-VARIABLE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-VARIABLE%20name%3D%22x-request-body-length%22%20value%3D%22%40%7B%0A%0A%26nbsp%3Breturn%20(string)context.Request.Headers.GetValueOrDefault(%22%20content-length%3D%22%22%3E%3C%2FSET-VARIABLE%3E%0A%0A%26nbsp%3B%20%3CSEND-REQUEST%20mode%3D%22new%22%20response-variable-name%3D%22tokenstate%22%20timeout%3D%222%22%20ignore-error%3D%22true%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-URL%3E%40%7B%0A%0A%26nbsp%3Breturn%20string.Format(%22https%3A%2F%2F%7B0%7D.file.core.windows.net%2FNamOfYourFileShares%2FFileNamewithextension%3FSASToken%20%22%2C(string)context.Variables%5B%22storageAccount%22%5D)%3B%0A%0A%26nbsp%3B%7D%3C%2FSET-URL%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-METHOD%3EPUT%3C%2FSET-METHOD%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-type%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3Efile%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-file-permission%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3Einherit%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-file-attributes%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3Enone%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-file-creation-time%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3Enow%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-file-last-write-time%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3Enow%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22x-ms-content-length%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E65336%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSEND-REQUEST%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FINBOUND%3E%0A%0A%3C%2Fcode%3E%3C%2Fpre%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_3-1591362160907.png%22%20style%3D%22width%3A%20779px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196720iAB3636DD2CC4BB05%2Fimage-dimensions%2F779x182%3Fv%3D1.0%22%20width%3D%22779%22%20height%3D%22182%22%20title%3D%22praskuma_3-1591362160907.png%22%20alt%3D%22praskuma_3-1591362160907.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%224%22%3E%0A%3CLI%3E%3CSTRONG%3EAfter%20saving%20the%20policy%2C%20go%20to%20the%20Test%20tab%20of%20API.%20Select%20that%20updated%20API%20operation%20and%20click%20on%20send.%20If%20all%20the%20updated%20parameters%20are%20authenticated%2C%20you%20will%20receive%20200%20OK%20and%20the%20trace%20will%20show%20201%20(Created)%20response%20code.%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_4-1591362160913.png%22%20style%3D%22width%3A%20713px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196718iC693001D0F927C6A%2Fimage-dimensions%2F713x336%3Fv%3D1.0%22%20width%3D%22713%22%20height%3D%22336%22%20title%3D%22praskuma_4-1591362160913.png%22%20alt%3D%22praskuma_4-1591362160913.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_5-1591362160919.png%22%20style%3D%22width%3A%20711px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196719iF86C3D52E5FF97A5%2Fimage-dimensions%2F711x304%3Fv%3D1.0%22%20width%3D%22711%22%20height%3D%22304%22%20title%3D%22praskuma_5-1591362160919.png%22%20alt%3D%22praskuma_5-1591362160919.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%225%22%3E%0A%3CLI%3E%3CSTRONG%3EThe%20new%20created%20file%20can%20be%20viewed%20in%20the%20File%20Shares%20%E2%80%93%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_6-1591362160925.png%22%20style%3D%22width%3A%20705px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196721i62120D422B8CA860%2Fimage-dimensions%2F705x231%3Fv%3D1.0%22%20width%3D%22705%22%20height%3D%22231%22%20title%3D%22praskuma_6-1591362160925.png%22%20alt%3D%22praskuma_6-1591362160925.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%226%22%3E%0A%3CLI%3E%3CSTRONG%3EIn%20case%2C%20we%20want%20to%20do%20the%20error%20handling%20we%20can%20add%20the%20on-error%20section%20to%20track%20the%20error%20responses%20as%20well.%20We%20need%20to%20add%20this%20block%20after%20outbound%20closing%20tag.%20This%20will%20give%20use%20information%20about%20the%20related%20errors.%20Reference%20link%20for%20APIM%20error%20handling-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-error-handling-policies%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-error-handling-policies%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3Cpre%20class%3D%22lia-code-sample%20language-json%22%3E%3Ccode%3E%3CON-ERROR%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorSource%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Source)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorReason%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Reason)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorMessage%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Message)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorScope%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Scope)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorSection%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Section)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorPath%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.Path)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorPolicyId%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.LastError.PolicyId)%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSET-HEADER%20name%3D%22ErrorStatusCode%22%20exists-action%3D%22override%22%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CVALUE%3E%40(context.Response.StatusCode.ToString())%3C%2FVALUE%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSET-HEADER%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CBASE%20%2F%3E%0A%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FON-ERROR%3E%0A%0A%3C%2Fcode%3E%3C%2Fpre%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22praskuma_7-1591362160934.png%22%20style%3D%22width%3A%20713px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F196722iDC7815864E3E0DD9%2Fimage-dimensions%2F713x335%3Fv%3D1.0%22%20width%3D%22713%22%20height%3D%22335%22%20title%3D%22praskuma_7-1591362160934.png%22%20alt%3D%22praskuma_7-1591362160934.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESimilarly%2C%20we%20can%20perform%20other%20operations%20like%20update%20and%20get%20by%20updating%20the%20required%20headers%20into%20the%20policy.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EReference%20link%20for%20File%20Share%20operation%20APIs%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Foperations-on-files%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Foperations-on-files%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1442921%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%20Management%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Storage%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFile%20Share%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFile%20Shares%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPolicy%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EREST%20API%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

APIM Policy to perform Azure Storage File Shares operations

In Azure API Management, policies are a powerful capability of the system that allow publishers to change the behavior of APIs through configuration. Policies are a collection of Statements that are executed sequentially on the request or response of an API.

Reference Article: https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-policies

 

Azure APIM policy expressions can also be used to perform operations such as Get, Create, Update and Delete on Azure Storage File Shares. In order to achieve this, we would require an inbound policy in the API operation configuration.

The steps for setting up the same are as below

 

Steps to add inbound policy to create a file in File Shares –

  1. Go to the API Management Service and select the APIs blade. Then choose the target API from the All APIs list.
  2. This will populate the underlying Operations associated with the chosen API.

    For this demo, we are using the sample Echo API which can be imported to your APIM service using the OpenApiSpecification URL linked below:

    https://conferenceapi.azurewebsites.net/?format=json

     

    Select POST (Create Resource) from the API operations list, as highlighted in the screenshot below:

 

praskuma_0-1591362160880.png

 

  1. Click on the </> sign to enter Edit mode and insert the new policy like in the below screenshot.

praskuma_1-1591362160888.png

 

praskuma_2-1591362160898.png

 

  1. Copy the below policy definition and paste in between the <inbound ></inbound> tags. Update the highlighted values with your Storage account details and save. Please make sure all the required headers are in the same format as below.

 

 

 

 

<inbound>

        <base />

        <!-- Initialize context variables with property values. -->

        <set-variable name="storageAccount" value="NameOfYourStorageAccount" />

        <set-variable name="x-request-body" value="@(context.Request.Body.As<string>())" />

        <set-variable name="x-request-body-length" value="@{

 return (string)context.Request.Headers.GetValueOrDefault("Content-Length","0");

}" />

  <send-request mode="new" response-variable-name="tokenstate" timeout="2" ignore-error="true">

            <set-url>@{

 return string.Format("https://{0}.file.core.windows.net/NamOfYourFileShares/FileNamewithextension?SASToken ",(string)context.Variables["storageAccount"]);

 }</set-url>

            <set-method>PUT</set-method>

            <set-header name="x-ms-type" exists-action="override">

                <value>file</value>

            </set-header>

            <set-header name="x-ms-file-permission" exists-action="override">

                <value>inherit</value>

            </set-header>

            <set-header name="x-ms-file-attributes" exists-action="override">

                <value>none</value>

            </set-header>

            <set-header name="x-ms-file-creation-time" exists-action="override">

                <value>now</value>

            </set-header>

            <set-header name="x-ms-file-last-write-time" exists-action="override">

                <value>now</value>

            </set-header>

            <set-header name="x-ms-content-length" exists-action="override">

                <value>65336</value>

            </set-header>

        </send-request>

    </inbound>

 

 

 

 

 

praskuma_3-1591362160907.png

 

 4. After saving the policy definition, maneuver to the Test tab of the same API. Select the updated API operation and click on Send. Upon successful authentication, you would receive a 200 OK response and the Ocp-Apim Trace would show a response code 201(Created).

 

praskuma_4-1591362160913.png

 

praskuma_5-1591362160919.png

 

  1. The new created file can be viewed in the File Shares –

 

praskuma_6-1591362160925.png

  1. In case, we want to do the error handling we can add the on-error section to track the error responses as well. We need to add this block after outbound closing tag. This will give use information about the related errors. Reference link for APIM error handling- https://docs.microsoft.com/en-us/azure/api-management/api-management-error-handling-policies

 

 

 

 

<on-error>

        <set-header name="ErrorSource" exists-action="override">

            <value>@(context.LastError.Source)</value>

        </set-header>

        <set-header name="ErrorReason" exists-action="override">

            <value>@(context.LastError.Reason)</value>

        </set-header>

        <set-header name="ErrorMessage" exists-action="override">

            <value>@(context.LastError.Message)</value>

        </set-header>

        <set-header name="ErrorScope" exists-action="override">

            <value>@(context.LastError.Scope)</value>

        </set-header>

        <set-header name="ErrorSection" exists-action="override">

            <value>@(context.LastError.Section)</value>

        </set-header>

        <set-header name="ErrorPath" exists-action="override">

            <value>@(context.LastError.Path)</value>

        </set-header>

        <set-header name="ErrorPolicyId" exists-action="override">

            <value>@(context.LastError.PolicyId)</value>

        </set-header>

        <set-header name="ErrorStatusCode" exists-action="override">

            <value>@(context.Response.StatusCode.ToString())</value>

        </set-header>

        <base />

    </on-error>

 

 

 

Sample response for an unauthorized operation upon integrating error-handling:

 

praskuma_7-1591362160934.png

 

Similarly, we can perform other operations like UPDATE and GET by modifying the required headers into the policy.

Reference link for File Share operation APIs - https://docs.microsoft.com/en-us/rest/api/storageservices/operations-on-files

 

 

2 Comments
Occasional Visitor

It was Helpful...thanks

Occasional Visitor

Good one.