Open MateusAmin opened 6 years ago
@MateusAmin Can you please provide the debug trace from the failed command invocation? Also, can you execute Resolve-AzureRmError
after the failure and provide the results?
'Can you please provide the debug trace from the failed command invocation?'
I have to spend a solid amount of time striping personal data from a debug trace. I will do it but I am not sure what the value add is here.
'Also, can you execute Resolve-AzureRmError after the failure and provide the results?'
I am using the Az module. I tried Resolve-AzError and got nothing.
In this case, it tells us whether the issue is on the client or server side. Here's the result of runnign Resolve-AzError, which tells us the server is returning the right thing (Webhook Not Found):
Message : The Automation account was not found.
StackTrace : at Microsoft.Azure.Commands.Automation.Cmdlet.AzureAutomationBaseCmdlet.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception : System.ArgumentException
InvocationInfo : {Set-AzAutomationWebhook}
Line : Set-AzAutomationWebhook -ResourceGroupName automationrepro2 -AutomationAccountName automationrepro2 -Name foo -Debug
Position : At line:1 char:1
+ Set-AzAutomationWebhook -ResourceGroupName automationrepro2 -Automati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 4
RequestId :
Message : Webhook not found.
ServerMessage : : (Webhook not found.)
ServerResponse : {NotFound}
RequestMessage : {GET https://management.azure.com/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb/resourceGroups/automationrepro2/providers/Microsoft.A
utomation/automationAccounts/automationrepro2/webhooks/foo?api-version=2015-10-31}
InvocationInfo : {Set-AzAutomationWebhook}
Line : Set-AzAutomationWebhook -ResourceGroupName automationrepro2 -AutomationAccountName automationrepro2 -Name foo -Debug
Position : At line:1 char:1
+ Set-AzAutomationWebhook -ResourceGroupName automationrepro2 -Automati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
StackTrace : at Microsoft.Azure.Management.Automation.WebhookOperations.GetAsync(String resourceGroupName, String automationAccount, String
webhookName, CancellationToken cancellationToken)
at Microsoft.Azure.Management.Automation.WebhookOperationsExtensions.Get(IWebhookOperations operations, String resourceGroupName,
String automationAccount, String webhookName)
at Microsoft.Azure.Commands.Automation.Common.AutomationClient.UpdateWebhook(String resourceGroupName, String automationAccountName,
String name, IDictionary parameters, Nullable`1 isEnabled)
at Microsoft.Azure.Commands.Automation.Cmdlet.SetAzureAutomationWebhook.AutomationProcessRecord()
at Microsoft.Azure.Commands.Automation.Cmdlet.AzureAutomationBaseCmdlet.ExecuteCmdlet()
HistoryId : 4
@vrdmr Per the above, this bad error message is a client-side error. Please take a look.
@mirichmo Could you please take a look at this issue? Thanks.
Yes, this is an issue with the error message.
@MateusAmin - Regarding your bonus question (my $0.02): No. "Set" cmdlets can optionally create resources, but in general, it is better to use "new" cmdlets for that. It is easier for users to understand the intention of "set" cmdlets if they only modify existing resources. For more details, check out the PowerShell approved verbs documentation.
The team will fix this.
Fix (the error message is incorrect)
Vikram, Jeff - please assign.
Description
Misleading error message for missing rr misspelled webhook name:
BONUS QUESTION: Should Set create when webhook does not exist?
Script/Steps for Reproduction
Where $WebhookName does not exist but AutomationAccountName does.
Module Version
Environment Data