Posts in Category: azure

Defining a JSON-Schema

To get started, if you haven’t already visited the JSON-Schema site, you can do so here.  Much of what I am writing on here, is there.

In defining your schema, there are a few elements I want to highlight in the below definition that starts off any JSON-Schema file.

"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://www.365concepts.com/json-schema.json",
"type": "object",
"title": "My JSON Data File",
"required": [
"id",
"people"
],
"additionalProperties": false,

In this document, we have indicated that it will be an object.  JSON-Schema supports many attributes one of which is object that allows us to create individual properties on the objects themselves.

The #id property is largely up to you, but take note of the #schema parameter as this is the specification that are binding to that outlines what you can and can’t do within it.

From there you have the standard title and

Read More


Using JSON Schema

I’ve been having to do some development lately around a project that requires strictly formatted data to be applied against a validated schema.  In looking at options, I evaluated JSON-Schema and XSD.  When looking around for which is better the results came back with neither side one is super superior to the other.  However, since this is for a REST service, I thought let’s go with JSON.

What I like about JSON-Schema is that it’s very quick to get up and running with.  The complete specification is available here and you can read through it in about an hour.  Over the next few posts I’ll highlight some of the key features of the schema and what I really like about it.

To get started, binding an already established file to a

Read More


Getting Started with Azure Application Insights

Where do those lovely trace statements that you write in your Azure Functions go?

How do you access them?

With some recent changes in logging in Azure, you can access all this information via Application Insights directly from your Azure Function.  When you access your function, underneath the “Configured features” sections you will see an option called “Application Insights.”

Clicking on this link will then bring you to a dashboard of real-time metrics that you might be spooling from your service.  However, for today, what we are interested in are the log files that are available from the top of the toolbar menu called “Logs”.

Logs

When

Read More


Azure Functions Local File Logging

In case you don’t know (I had no idea), here it is – the location of your log files when using the ILogger interface for Azure Functions.

%temp%\LogFiles\Application\Functions

Once there, you will be able to drill into your functions by name and find the log file(s) associated with that function.

logfiles

It’s also good practice to enable local file logging in your host.json file using the following syntax.

  "logging": {
    "fileLoggingMode": "always"
  }

Read More


Azure Function Publish Failed

I had a few instances last week where I was getting this incredibly descriptive error message. When I dug into the logs, I got an even more descript messaging saying that “Publishing had failed.”

Both lead me nowhere and after deleting publishing profiles, pulling them down, pushing them back, doing whatever I could, nothing seemed to function.

Cue finding out about this key in on my function itself – WEBSITE_RUN_FROM_PACKAGE 

By default, when you create your function in Azure, this is set to 1. However, for Web Deploy to work (i.e., from Visual Studio), this needs to be set to 0.

Once I did that, boom, publishing was working solidly like a rock once

Read More