Posts in Category: azure

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


Finding your Azure Tenant Id

If you’re connecting with the Dynamics Web API in a Function or Service, you need to know your Azure Tenant Id.  If you don’t have a custom domain, this is relatively simple, but if you do have a custom domain, it can be slightly obscured and/or completely hidden from what you are doing.

To find you Tenant Id, simply go to the Azure Active Directory, scroll down to Custom Domains and look for the domain that looks something like xxxxxxxx.onmicrosoft.com.

aad.PNG

That will be thetenant id that you will want to connect with, not your custom domain name.

Read More


Debugging Azure Functions Locally

If you’re storing configuration keys in Azure Functions, there is this really cool facility called Application Settings where you can create all these keys and access them when your function runs.

HOWEVER, when running your Azure Function locally, these keys do not automatically download and you need to add them into your local.settings.json file for them to be consumed.

After you have done this, next you need to make sure that this file is set to “Copy if newer” because if it isn’t you’ll never get to consume those values.

I ran into the above very innocently by trying to troubleshoot the granddaddy of all problems – why my AzureWebJobsStorage parameter was empty and I was not able to download what I needed from my Azure portal into it.

Amateur Tip: If this value

Read More