Save-AzureRmDataFactoryLog

Downloads log files from Azure HDInsight processing.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Save-AzureRmDataFactoryLog
    [-DataFactoryName] <String>
    [-Id] <String>
    [-DownloadLogs]
    [[-Output] <String>]
    [-ResourceGroupName] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Save-AzureRmDataFactoryLog
    [-DataFactory] <PSDataFactory>
    [-Id] <String>
    [-DownloadLogs]
    [[-Output] <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<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.

Parameters

-DataFactory

Specifies a PSDataFactory object.

Type:PSDataFactory
Position:0
Default value:None
Required:True
Accept pipeline input:True
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:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-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
Required:False
Accept pipeline input:False
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:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Output

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

Type:String
Position:2
Default value:None
Required:False
Accept pipeline input:False
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:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

PSDataFactory

String

Outputs

PSRunLogInfo

Notes

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