0 Comments

WHAT ARE AZURE FUNCTIONS?

Azure functions are event or trigger driven functions that you can build on Microsoft Azure which you can implement using variety of languages and leverage a lot of Azure features like Continuous Deployment and Integration, Scaling up and Scaling out, Hybrid connections and etc.

The Azure Functions idea is that you need to implement a simple integration between your On-Premise or Cloud resources and you don't want to build a complete service and just a simple function in the cloud will do the job.

How to create Azure Functions?

Currently there are 2 options to create Azure Functions. You can either go to https://portal.azure.com, and Create a Function App or go to https://functions.azure.com and create the Azure Function.

This is what the https://functions.azure.com looks like:

Azure Functions Portal

For this tutorial I will demonstrate to use the https://portal.azure.com portal.

Once you login to the Azure portal, you click on New and select Function Apps, enter the Azure Function name and select the storage account (or create a new one) and click on Create.

Azure Functions - Azure Portal

Then you will be taken to the Get Started page where you can select to start based on some existing apps or start from scratch or you can import your code if you have here and start from there.

I will show to start from scratch and for that I click on the little link that says: "Create a new function from scratch" and that will take me to the page what I can select the language and again some templates with some scaffolding code in them.

Azure Functions - Start


When you click on the link you are redirected to the below page with all different Azure Functions templates.

As you can see, there is a dropdown for Language that you can pick from (Batch, C#, JavaScript, Bash, F#, Php, Powershell, Python are the options you have at the moment) and there is a Scenario dropdown too which you can filter the templates using that one.

I will go ahead and select the BlobTrigger - C# template which is a function that will be run whenever a blob is added to a specified container.

Which container will be watched? you specify that below the screen (select the Storage Account - or create new one and enter the Path to your container in the Storage Account) and click Create.

Azure Functions - Templates

Then you will be taken to the Develop page where you see the function body there and you can start coding.

Azure Functions - Code

At the bottom of this page, there is the Logs and Input and Output windows where you can run the function and see the logs and the output right there.

Azure Functions - Run Logs

The next tab, is the Integrate tab, where you can integrate with other resources and read from one resource and send it to other resources and basically pass the output through any other storage (Blob Storage, Table Storage, DocumentDB, or Azure Mobile Easy table).

6 - Azure Functions - Integrate

The last tab you see is the Monitor Tab which is still work in progress and is not released yet, so if you go there you will see below page:

Azure Functions - Monitor

In total the Azure Functions seems to be another cool integration/job/event based solution similar and at the same time different like Azure Logic Apps and Or Azure Web Jobs.

I'm sure you can find great use cases for this new Azure Functions feature, but just keep in mind that this feature is still in Preview.




0 Comments

WHAT IS AZURE AUDIT LOGS

Using Azure Audit logs anything you do to the Azure resources in the azure portal or through Powershell is completely logged and you can go back to them and see who did what and when!

The audit log is done by Azure Resource Manager and it logs anything about creating, deleting or editing an Azure resource or if you grant or revoke permission to a user or to a resource.

You can go through these logs at any time using the Azure portal or you can use the Azure Rest API to go through these audit logs.

Recently Azure team has announced that you can Archive and stream the Azure Audit logs in your Azure Blob storage account for your future use and use tools/add-on like Splunkto view these logs and analyze them.

In this post I will show you how to go through Audit logs in the Azure portal:

Drill in to Azure audit logs

First you login to Azure Portal and from the left menu click on Browse and in the Filter box type in "Audit Logs":

Azure Audit Logs

Then you click on the Audit Logsmenu and you can see the summary of the Audit logs with the chart on top that shows the logs for the past 7 days (you can change the time filter if you like):

and at the bottom there are the details of the events that happened and you can drill in to the ones that you are interested in:

Azure Audit Logs

Now I just click on the one error case there with is for a Backup operation on "koukia" (A website that I host in Azure) resource (Resource column shows you which resource is the audit related to)

and I can see the details of the error, the message and the Correlation Id that I can use to see the complete list of events with that unique Id or in case I need to follow up with Azure Support that Id might come in handy for them:

3 - Azure Audit Logs details

You can also set Alert Notifications based on the events that you see in the Audit logs, like you want to get an alert if a Backup operation failed or things like that.