Skip to content

Back End Team Task #4: Develop Azure Function that transforms Base64 encoded JSON property and logs this in App Insights

hken920 edited this page Jan 28, 2020 · 17 revisions

https://github.com/North-Seattle-College/ad440-winter2020-tuesday-repo/issues/5

Prerequisite: IoT Hub resource

Step 1: Create encoded base64

Step2: Decode base64 using web browser

  • Copy encoded base64 from step #1 and paste to end of URL below

https://ken-fun-feat-usw2-task5.azurewebsites.net/api/base64decode?code=zDPBuJFjpO7FX7u1zPECPLa1x5IY5USgxi77/wwR44r1ioOzGgZueQ==&base64Decode=

 Example: https://ken-fun-feat-usw2-task5.azurewebsites.net/api/base64decode?code=zDPBuJFjpO7FX7u1zPECPLa1x5IY5USgxi77/wwR44r1ioOzGgZueQ==&base64Decode=<encoded base64 message here>
  • Output in web browser should show --> Output: decoded message

Step3: Navigate to Function Apps

  • Sign in Azure portal > search and select Function Apps > ken-fun-feat-usw2-task5 > Monitor (located on the left).

Step4: Select function logs

  • To see the logs for a particular function invocation, select the Date column link for that invocation.

Step5: View logs in App Insights

  • Under "Invocation Details" click Run in Applications Insights

Log should look something similar to this:

1/27/2020, 12:38:31.281 AM	Executing 'Functions.base64Decode' (Reason='This function was programmatically called via the host APIs.', Id=79110850-793b-479f-b353-d4c6bf06ab9f)	Information	
1/27/2020, 12:38:31.291 AM	Python HTTP trigger function processed a request.	Information	
1/27/2020, 12:38:31.294 AM	Base64 decode complete. Output: b'ken hsu north seattle college'	Information	
1/27/2020, 12:38:31.297 AM	Executed 'Functions.base64Decode' (Succeeded, Id=79110850-793b-479f-b353-d4c6bf06ab9f)	Information	
Clone this wiki locally