Unable to access Azure VM details using activities

RemoteException wrapping System.Activities.Statements.WorkflowTerminatedException: VM vmhr from Resource Group hrtestrsg not found. —> RemoteException wrapping UiPath.Azure.Core.AzureException: Unable to find or retrieve virtual machine “vmhr” in resource group “hrtestrsg” Error: AADSTS700016: Application with identifier ‘abc’ was not found in the directory ‘Default Directory’. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.
Trace ID: c923bb72-690a-46cc-81b3-2b5c84780f00
Correlation ID: a48957fc-1e53-41c7-bbc1-a01e2cfdd9eb
Timestamp: 2022-10-31 13:50:11Z —> RemoteException wrapping Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException: AADSTS700016: Application with identifier ‘abc’ was not found in the directory ‘Default Directory’. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.
Trace ID: c923bb72-690a-46cc-81b3-2b5c84780f00
Correlation ID: a48957fc-1e53-41c7-bbc1-a01e2cfdd9eb
Timestamp: 2022-10-31 13:50:11Z —> RemoteException wrapping System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (BadRequest). —> RemoteException wrapping Microsoft.IdentityModel.Clients.ActiveDirectory.AdalException: {“error”:“unauthorized_client”,“error_description”:“AADSTS700016: Application with identifier ‘abc’ was not found in the directory ‘Default Directory’. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.\r\nTrace ID: c923bb72-690a-46cc-81b3-2b5c84780f00\r\nCorrelation ID: a48957fc-1e53-41c7-bbc1-a01e2cfdd9eb\r\nTimestamp: 2022-10-31 13:50:11Z”,“error_codes”:[700016],“timestamp”:“2022-10-31 13:50:11Z”,“trace_id”:“c923bb72-690a-46cc-81b3-2b5c84780f00”,“correlation_id”:“a48957fc-1e53-41c7-bbc1-a01e2cfdd9eb”,“error_uri”:“https://login.microsoftonline.com/error?code=700016”}: Unknown error

--- End of inner exception stack trace ---

--- End of inner exception stack trace ---

at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Http.AdalHttpClient.d__221.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Http.AdalHttpClient.<GetResponseAsync>d__211.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase.d__68.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase.d__65.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase.d__55.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase.d__53.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.d__36.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.d__65.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Rest.Azure.Authentication.Internal.MemoryApplicationAuthenticationProvider.d__4.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Rest.Azure.Authentication.ApplicationTokenProvider.d__37.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Rest.Azure.Authentication.ApplicationTokenProvider.d__19.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Rest.Azure.Authentication.ApplicationTokenProvider.d__17.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.Azure.Management.ResourceManager.Fluent.Authentication.AzureCredentials.<ProcessHttpRequestAsync>d__24.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.Management.Compute.Fluent.VirtualMachinesOperations.<GetWithHttpMessagesAsync>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.Azure.Management.Compute.Fluent.VirtualMachinesOperationsExtensions.d__5.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.Azure.Management.Compute.Fluent.VirtualMachinesImpl.<GetInnerByGroupAsync>d__61.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at Microsoft.Azure.Management.ResourceManager.Fluent.Core.GroupableResources5.<GetByResourceGroupAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.Azure.Services.AzureVirtualMachineService.<GetAsync>d__3.MoveNext() --- End of inner exception stack trace --- at UiPath.Azure.Services.AzureVirtualMachineService.<GetAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at UiPath.Azure.Activities.AzureActivity1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of inner exception stack trace —

Are you trying to search it with right details ? Please share us some activity screenshots

@Nithinkrishna FYI.



Hey @sumitctm

Please show the Azure scope and Azure VM sequence activities with props.

Also as we see in the error it clearly states the VM resource is not present in the directory.

I think you also need to check that area once.

Thanks
#nK



@Nithinkrishna I don’t think so because I can see VM & RG successfully deployed at Azure side.

Okay so looks like it is deployed in the default directory. So can you please show the activity with which you are performing the VM search ?

@Nithinkrishna ?

1 Like

Hi @sumitctm

Kindly check your DM.

Thanks
#nK

Hey @sumitctm

Also I got a clue like your secret has some special characters right ?

Just thinking if that is causing some issue, Can you try to get the secret directly from asset and pass it through the activity.

Thanks
#nK