Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureResourceGroupLog

Get-AzureResourceGroupLog

microsoft.azure.commands.resources.dll, microsoft.azure.commands.insights.dll

Synopsis

Gets the deployment log for a resource group

Syntax

Get-AzureResourceGroupLog [-Name] [<CommonParameters>]

Get-AzureResourceGroupLog [-Name] [-All] [<CommonParameters>]

Get-AzureResourceGroupLog [-Name] [-DeploymentName] [<CommonParameters>]

Detailed Description

The Get-AzureResourceGroupLog cmdlet gets the deployment log entries for a resource group. The entries are very useful for many IT tasks, including maintaining a transaction history, performing statistical analyses, and debugging.By default, Get-AzureResourceGroupLog gets the log entries of the currently running or most recently completed deployment for the resource group, but you can use the cmdlet parameters to get the entries for a particular deployment by name or all deployments.

Parameters

-Name <String>

Specifies the name of a resource group. This parameter is required. Enter the name of one resource group in each command.

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-All <SwitchParameter>

Gets all deployment log entries for the resource group.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-DeploymentName <String>

Gets the log entries for the deployments with the specified name.To get the names of deployments for a resource group, use the Get-AzureResourceGroupDeployment cmdlet. To specify a deployment name when deploying resources, use the DeploymentName parameter of New-AzureResourceGroup or the Name parameter (alias DeploymentName) of the New-AzureResourceGroupDeployment cmdlets.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

Input Type

None

Return Type

Microsoft.Azure.Commands.ResourceManagement.Models.PSDeploymentEventData

Notes

The Get-AzureResourceGroupLog cmdlet is included in the Azure Resource Manager module beginning in module version 0.8.0.

Examples

-------------------------- Example 1: Get the log entries for the most recent deployment --------------------------

This command gets the log entries of the currently running or most recently completed deployment of the ContosoRG01 resource group. In this case, the log entries records the addition of a new web site.

PS C:\>Get-AzureResourceGroupLog -Name ContosoRG01
Authorization     : 
                    Scope           : /subscriptions/9b14a38b-4b93-4554-8bb0-3cefb47a4e1f/resourcegroups/ContosoLabsRG/deployments/LabDeploy02
                    Action          : Microsoft.Resources/subscriptions/resourcegroups/deployments/write
                    Role            : Subscription Admin
                    Condition       : 
ResourceUri       : /subscriptions/9b14a38b-4b93-4554-8bb0-3cefb47a4e1f/resourcegroups/ContosoLabsRG/deployments/LabDeploy02
SubscriptionId    : 9b14a38b-4b93-4554-8bb0-3cefb47a4e1f
Timestamp(UTC)    : 3/21/2014 9:17:33 PM
OperationName     : Update deployment
OperationId       : 4877e67f-868b-4b3e-8778-4a40ee3a1af2
Status            : Succeeded
SubStatus         : Created
Caller            : live.com#auxtm702@live.com
CorrelationId     : 4877e67f-868b-4b3e-8778-4a40ee3a1af2Description       : 
HttpRequest       : 
                    ClientId        : 
                    Method          : PUT
                    Url             : 
                    ClientIpAddress : 131.107.192.39
Level             : Informational
ResourceGroupName : ContosoLabsRG
ResourceProvider  : Microsoft Resources
EventSource       : Microsoft Resources
Properties        : 
                    statusCode     : Created

-------------------------- Example 2: Get log entries by deployment name --------------------------

These commands get the log entries of the LabDeploy02 deployment of the ContosoLabsRG resource group.

PS C:\>(Get-AzureResourceGroupDeployment -ResourceGroupName ContosoLabsRG).DeploymentNameMicrosoft.WebSiteSQLDatabase.0.1.0-preview1LabDeploy02LabDeploy03
PS C:\>Get-AzureResourceGroupLog -Name ContosoLabsRG -DeploymentName LabDeploy02

-------------------------- Example 3: Get all failing log entries for a resource group --------------------------

This command gets all log entries of failed operations for the ContosoRG01 resource group. You might use a command like this for debugging.

PS C:\>Get-AzureResourceGroupLog -Name ContosoRG01 -All | Where-Object Status -eq Failed

-------------------------- Example 4: Get the logs of the most recent deployment for each resource group --------------------------

This command gets the log entries for the most recent deployment of each resource group in the subscription. The command uses the Get-AzureResourceGroup cmdlet to get all resource groups in the subscription. It pipes the resources groups to the Get-AzureResourceGroupLog which gets the log entries for the last deployment of each resource group.

PS C:\>Get-AzureResourceGroup | Get-AzureResourceGroupLog

Online Version