# Logs to Azure

## Overview <a href="#overview" id="overview"></a>

The Support Application provides a method of sending log files to Azure Cloud storage. To utilize the Logs to Azure feature, an Azure Connection String and storage Container will need to be created within the Azure Storage Accounts.

## User Guide

1. To enable the Sending Log Files to Azure feature, you need to configure the following basic values:

* submitLogs - Define the Log files to upload
* loggingConnection - The Azure Connection string within Azure Storage Accounts
* loggingContainer - The Azure Blob Storage container name

2. Once the feature is enabled, the Support Application will start sending log files to Azure. The log files will be stored in Azure in a format that can be easily accessed and analyzed.

## Feature Configuration <a href="#configuration" id="configuration"></a>

To set up Logs to Azure for a particular device profile or device group, please follow the steps below:

### Setting Up The Logging Connection

Specify the connection string to authenticate and connect to the Azure storage account.&#x20;

```json
"loggingConnection" : "DefaultEndpointsProtocol=https;AccountName=blah;AccountKey=blah==;EndpointSuffix=core.windows.net"
```

### Defining the Container Name

Specify the container name within the storage account where logs will be stored.

```json
 "loggingContainer" : "a-container-name"
```

### Enabling Log Submissions

If the enabled property of submitLogs is set to true, logs will be submitted to the configured destination.

```json
 "submitLogs": {
         "enabled" :  true
```

### Disabling the Alarm

If the alarmEnabled property of submitLogs is set to false, no alarms will be triggered based on the logs submitted.

```json
"submitLogs": {
         "alarmEnabled" :  false
```

### Sending Log Files Automatically

If the "sendOnBoot" property of "submitLogs" is set to true, it will automatically send logs when the application boots up.

```json
 "submitLogs": {
         "sendOnBoot": true
```

### Configuring the Log File Directory

Specify the list of directories where log files can be found.

```json
 "directories" : [
            {
                "application" : "application.name",
                "location" : "/sdcard/customapp/",
                "files" : "applog.txt"
```

### Putting It All Together <a href="#putting-it-all-together-9" id="putting-it-all-together-9"></a>

For the example described above, the full configuration for the Logs to Azure feature is as follows:

```json
{
  ....
  "loggingConnection" : "DefaultEndpointsProtocol=https;AccountName=blah;AccountKey=blah==;EndpointSuffix=core.windows.net",
  "loggingContainer" : "a-container-name",
  "submitLogs": {
         "enabled" :  true,
         "alarmEnabled" :  false,
         "sendOnBoot": true,
         "directories" : [
            {
                "application" : "application.name",
                "location" : "/sdcard/customapp/",
                "files" : "applog.txt"
            }
        ]
  },
  ...
}
```

{% hint style="info" %}
Logs to Azure was introduced in Support Application 4.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bluefletch.com/bluefletch-enterprise/product-guides/support-application/features/logs-to-azure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
