Save-​Azure​Rm​Data​Factory​Log

Downloads log files from Azure HDInsight processing.

Syntax

Save-AzureRmDataFactoryLog
    [-DataFactory] <PSDataFactory>
    [-Id] <String>
    [[-Output] <String>]
    [-DownloadLogs]
    [<CommonParameters>]
Save-AzureRmDataFactoryLog
    [-ResourceGroupName] <String>
    [-DataFactoryName] <String>
    [-Id] <String>
    [[-Output] <String>]
    [-DownloadLogs]
    [<CommonParameters>]

Description

The Save-AzureRmDataFactoryLog cmdlet downloads log files associated with Azure HDInsight processing of Pig or Hive projects or for custom activities to your local hard drive. You first run the Get-AzureRmDataFactoryRun cmdlet to get an ID for an activity run for a data slice, and then use that ID to retrieve log files from the binary large object (BLOB) storage associated with the HDInsight cluster.

If you do not specify the DownloadLogs parameter, the cmdlet just returns the location of log files.

If you specify DownloadLogs without specifying an output directory (Output parameter), the log files are downloaded to the default Documents folder.

If you specify DownloadLogs along with an output folder (Output), the log files are downloaded to the specified folder.

Examples

Example 1: Save log files to a specific folder

PS C:\>Save-AzureRmDataFactoryLog -ResourceGroupName "ADF" -DataFactoryName "LogProcessingFactory" -Id "841b77c9-d56c-48d1-99a3-8c16c3e77d39" -DownloadLogs -Output "C:\Test"

This command saves log files for the activity run with the ID of 841b77c9-d56c-48d1-99a3-8c16c3e77d39 where the activity belongs to a pipeline in the data factory named LogProcessingFactory in the resource group named ADF. The log files are saved to the C:\Test folder.

Example 2: Save log files to default Documents folder

PS C:\>Save-AzureRmDataFactoryLog -ResourceGroupName "ADF" -DataFactoryName "LogProcessingFactory" -Id "841b77c9-d56c-48d1-99a3-8c16c3e77d39" -DownloadLogs

This command saves log files to Documents folder (default).

Example 3: Get the location of log files

PS C:\>Save-AzureRmDataFactoryLog -ResourceGroupName "ADF" -DataFactoryName "LogProcessingFactory" -Id "841b77c9-d56c-48d1-99a3-8c16c3e77d39"

This command returns the location of log files. Note that DownloadLogs is not specified.

Required Parameters

-DataFactory

Specifies a PSDataFactory object.

Type:PSDataFactory
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DataFactoryName

Specifies the name of a data factory. This cmdlet downloads log files for the data factory that this parameter specifies.

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Id

Specifies the ID of the activity run for the data slice. Use the Get-AzureRmDataFactoryRun cmdlet to get an ID.

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of an Azure resource group. This cmdlet creates a data factory that belongs to the group that this parameter specifies.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-DownloadLogs

Indicates that this cmdlet downloads log files to your local computer. If Ouptut folder is not specified, files are saved to Documents folder under a subfolder.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Output

Specifies the output folder in which the downloaded log files are saved.

Type:String
Position:3
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Notes

  • Keywords: azure, azurerm, arm, resource, management, manager, data, factories