< Back

Resolve-AzureRmError

Tue Jan 29, 2019 9:59 pm

NAME Resolve-AzureRmError



SYNOPSIS

Display detailed information about PowerShell errors, with extended details for Azure PowerShell errors.





SYNTAX

Resolve-AzureRmError [[-Error] <ErrorRecord[]>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]



Resolve-AzureRmError [-DefaultProfile <IAzureContextContainer>] -Last [<CommonParameters>]





DESCRIPTION

Resolves and displays detailed information about errors in the current PowerShell session, including where the error occurred in script, stack

trace, and all inner and aggregate exceptions. For Azure PowerShell errors provides additional detail in debugging service issues, including

complete detail about the request and server response that caused the error.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, tenant and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Error <ErrorRecord[]>

One or more error records to resolve. If no parameters are specified, all errors in the session are resolved.



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Last [<SwitchParameter>]

Resolve only the last error that occurred in the session.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.Management.Automation.ErrorRecord[]







OUTPUTS

Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord

Information about a powershell error that does not involve an excpetion.



Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord

Information about an error including detailed information on the exception that raised the error.



Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord

Information about errors in cleint/server communications. This will often contain important information about the error from the server.





NOTES









Example 1: Resolve the Last Error



PS C:\\> Resolve-AzureRmError -Last



HistoryId: 3





Message : Run Connect-AzureRmAccount to login.

StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in AzureRmCmdlet.cs:line 85

at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in AzureRmCmdlet.cs:line 269

at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() inAzurePSCmdlet.cs:line 299

at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in AzureRmCmdlet.cs:line 320

at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in GetAzureRMSubscription.cs:line 49

at System.Management.Automation.Cmdlet.DoBeginProcessing()

at System.Management.Automation.CommandProcessorBase.DoBegin()

Exception : System.Management.Automation.PSInvalidOperationException

InvocationInfo : {Get-AzureRmSubscription}

Line : Get-AzureRmSubscription

Position : At line:1 char:1

+ Get-AzureRmSubscription

+ ~~~~~~~~~~~~~~~~~~~~~~~

HistoryId : 3



Get details of the last error.





Example 2: Resolve all Errors in the Session



PS C:\\> Resolve-AzureRmError





HistoryId: 8





RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d

Message : Resource group 'contoso' could not be found.

ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found.

(System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError])

ServerResponse : {NotFound}

RequestMessage : {GET https://management.azure.com/subscripti ... eGroups/co

ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01}

InvocationInfo : {Get-AzureRmStorageAccount}

Line : Get-AzureRmStorageAccount -ResourceGroupName contoso -Name contoso

Position : At line:1 char:1

+ Get-AzureRmStorageAccount -ResourceGroupName contoso -Name contoso

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync

>d__8.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7.

MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc

ountsOperations operations, String resourceGroupName, String accountName)

at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\\

zd\\azure-powershell\\src\\ResourceManager\\Storage\\Commands.Management.Storage\\StorageAccount\\GetAzureSto

rageAccount.cs:line 70

at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in

C:\\zd\\azure-powershell\\src\\Common\\Commands.Common\\AzurePSCmdlet.cs:line 642

HistoryId : 8





HistoryId: 5





Message : Run Connect-AzureRmAccount to login.

StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in C:\\zd\\azur

e-powershell\\src\\ResourceManager\\Common\\Commands.ResourceManager.Common\\AzureRmCmdlet.cs:line 85

at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in

C:\\zd\\azure-powershell\\src\\ResourceManager\\Common\\Commands.ResourceManager.Common\\AzureRmCmdlet.cs:lin

e 269

at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() in

C:\\zd\\azure-powershell\\src\\Common\\Commands.Common\\AzurePSCmdlet.cs:line 299

at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in C:\\zd\\azure-p

owershell\\src\\ResourceManager\\Common\\Commands.ResourceManager.Common\\AzureRmCmdlet.cs:line 320

at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in C:\\zd\\azure-

powershell\\src\\ResourceManager\\Profile\\Commands.Profile\\Subscription\\GetAzureRMSubscription.cs:line 49

at System.Management.Automation.Cmdlet.DoBeginProcessing()

at System.Management.Automation.CommandProcessorBase.DoBegin()

Exception : System.Management.Automation.PSInvalidOperationException

InvocationInfo : {Get-AzureRmSubscription}

Line : Get-AzureRmSubscription

Position : At line:1 char:1

+ Get-AzureRmSubscription

+ ~~~~~~~~~~~~~~~~~~~~~~~

HistoryId : 5



Get details of all errors that have occurred in the current session.





Example 3: Resolve a Specific Error



PS C:\\> Resolve-AzureRmError $Error[0]





HistoryId: 8





RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d

Message : Resource group 'contoso' could not be found.

ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found.

(System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError])

ServerResponse : {NotFound}

RequestMessage : {GET https://management.azure.com/subscripti ... eGroups/co

ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01}

InvocationInfo : {Get-AzureRmStorageAccount}

Line : Get-AzureRmStorageAccount -ResourceGroupName contoso -Name contoso

Position : At line:1 char:1

+ Get-AzureRmStorageAccount -ResourceGroupName contoso -Name contoso

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync

>d__8.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7.

MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc

ountsOperations operations, String resourceGroupName, String accountName)

at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\\

zd\\azure-powershell\\src\\ResourceManager\\Storage\\Commands.Management.Storage\\StorageAccount\\GetAzureSto

rageAccount.cs:line 70

at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in

C:\\zd\\azure-powershell\\src\\Common\\Commands.Common\\AzurePSCmdlet.cs:line 642

HistoryId : 8



Get details of the specified error.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... urermerror