Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-MgInstantiateApplicationTemplate is running it is successfully creating the application, however throws an error #2135

Closed
SuryenduB opened this issue Jul 7, 2023 · 2 comments

Comments

@SuryenduB
Copy link

Describe the bug

When Invoke-MgInstantiateApplicationTemplate is running it is successfully creating the application, however throws an error

To Reproduce
Steps to reproduce the behavior:

  1. Execute $params = @{ displayName = $displayName } Invoke-MgInstantiateApplicationTemplate -ApplicationTemplateId $applicationTemplateId -BodyParameter $params with ...
  2. See error at `Invoke-MgInstantiateApplicationTemplate : One or more errors occurred.
    At C:\Users\14784425548699500622\Documents\Scripts\AzureADScripts\AutomatedProvisioningEnterpriseA
    pp.ps1:57 char:2
  • Invoke-MgInstantiateApplicationTemplate -ApplicationTemplateId $a ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Invoke-MgInstan...ate_Instantiate], AggregateExc
      eption
    • FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Cmdlets.InvokeMgInstantiateApplicationTe
      mplate_Instantiate`

Expected behavior

A clear and concise description of what you expected to happen.

Debug Output

Run the problematic command with -Debug and paste the resulting debug stream below.
⚠ ATTENTION: Be sure to remove any sensitive information that may be in the logs.
DEBUG: [CmdletBeginProcessing]: - Invoke-MgInstantiateApplicationTemplate begin processing with
parameterSet 'Instantiate'.

Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): A
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser',
ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line Tools'.
DEBUG: [Authentication]: - Scopes: [AdministrativeUnit.ReadWrite.All, Application.Read.All,
Application.ReadWrite.All, AppRoleAssignment.ReadWrite.All, AuditLog.Read.All,
CrossTenantInformation.ReadBasic.All, CustomSecAttributeDefinition.Read.All,
CustomSecAttributeDefinition.ReadWrite.All, Directory.AccessAsUser.All, Directory.Read.All,
Directory.ReadWrite.All, DirectoryRecommendations.Read.All, EntitlementManagement.Read.All,
openid, Organization.Read.All, Policy.Read.All, profile, RoleAssignmentSchedule.Read.Directory,
RoleEligibilitySchedule.Read.Directory, RoleManagement.Read.All,
RoleManagement.ReadWrite.Directory, Synchronization.Read.All, Synchronization.ReadWrite.All,
User.Read, User.Read.All, User.ReadWrite.All, UserAuthenticationMethod.Read.All, email].

Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke-MgInstantiateApplicationTemplate_Instantiate" on target "Call
remote 'POST /applicationTemplates/{applicationTemplate-id}/microsoft.graph.instantiate'
operation".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): A
DEBUG: [CmdletException]: Received exception with message 'AggregateException - One or more errors
occurred. : at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean
includeTaskCanceledExceptions)
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()
at Microsoft.Graph.PowerShell.EventFactory.CreateLogEvent(Task`1 message)
at Microsoft.Graph.PowerShell.Module.<>c__DisplayClass3_2.b__2()
at
Microsoft.Graph.PowerShell.Cmdlets.InvokeMgInstantiateApplicationTemplate_Instantiate.<>c__Display
Class52_0.<Microsoft.Graph.PowerShell.Runtime.IEventListener.Signal>b__1()
at
Microsoft.Graph.PowerShell.Cmdlets.InvokeMgInstantiateApplicationTemplate_Instantiate.d__52.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.Graph.PowerShell.Module.d__3.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.Graph.PowerShell.Module.d__0.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.Graph.PowerShell.Module.d__32.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.Graph.PowerShell.Cmdlets.InvokeMgInstantiateApplicationTemplate_Instantiate.d__52.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.Graph.PowerShell.Applications.<ApplicationTemplateInstantiate_Call>d__463.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at
Microsoft.Graph.PowerShell.Applications.<ApplicationTemplateInstantiate_Call>d__463.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.Graph.PowerShell.Applications.d__461.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.Graph.PowerShell.Cmdlets.InvokeMgInstantiateApplicationTemplate_Instantiate.d__54.MoveNext()'

Confirm
One or more errors occurred.
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): A
Invoke-MgInstantiateApplicationTemplate : One or more errors occurred.
At C:\Users\14784425548699500622\Documents\Scripts\AzureADScripts\AutomatedProvisioningEnterpriseA
pp.ps1:57 char:2

  • Invoke-MgInstantiateApplicationTemplate -ApplicationTemplateId $a ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Invoke-MgInstan...ate_Instantiate], AggregateExc
      eption
    • FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Cmdlets.InvokeMgInstantiateApplicationTe
      mplate_Instantiate

DEBUG: [CmdletEndProcessing]: - Invoke-MgInstantiateApplicationTemplate end processing.

Module Version

Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version Name ExportedCommands


Manifest 2.0.0 Microsoft.Graph
Script 2.0.0 Microsoft.Graph.Applications {Add-MgApplicationKey, Add-MgApplicat...
Script 2.0.0 Microsoft.Graph.Authentication {Connect-MgGraph, Disconnect-MgGraph,...
Script 2.0.0 Microsoft.Graph.Beta.Applications {Add-MgBetaApplicationKey, Add-MgBeta...
Script 2.0.0 Microsoft.Graph.Bookings {Get-MgBookingBusiness, Get-MgBooking...
Script 2.0.0 Microsoft.Graph.Calendar {Get-MgGroupCalendar, Get-MgGroupCale...
Script 2.0.0 Microsoft.Graph.ChangeNotifications {Get-MgSubscription, Invoke-MgReautho...
Script 2.0.0 Microsoft.Graph.CloudCommunications {Add-MgCommunicationCallLargeGalleryV...
Script 2.0.0 Microsoft.Graph.Compliance {Get-MgCompliance, Update-MgCompliance}
Script 2.0.0 Microsoft.Graph.CrossDeviceExper... {Get-MgUserActivity, Get-MgUserActivi...
Script 2.0.0 Microsoft.Graph.DeviceManagement {Get-MgDeviceManagement, Get-MgDevice...
Script 2.0.0 Microsoft.Graph.DeviceManagement... {Clear-MgDeviceManagementManagedDevic...
Script 2.0.0 Microsoft.Graph.DeviceManagement... {Get-MgDeviceManagementApplePushNotif...
Script 2.0.0 Microsoft.Graph.DeviceManagement... {Get-MgDeviceManagementConditionalAcc...
Script 2.0.0 Microsoft.Graph.DeviceManagement... {Confirm-MgDeviceManagementWindowsEnr...
Script 2.0.0 Microsoft.Graph.Devices.CloudPrint {Get-MgPrint, Get-MgPrintConnector, G...
Script 2.0.0 Microsoft.Graph.Devices.Corporat... {Get-MgDeviceAppManagement, Get-MgDev...
Script 2.0.0 Microsoft.Graph.Devices.ServiceA... {Get-MgServiceAnnouncementHealthOverv...
Script 2.0.0 Microsoft.Graph.DirectoryObjects {Confirm-MgDirectoryObjectMemberGroup...
Script 2.0.0 Microsoft.Graph.Education {Get-MgEducationClass, Get-MgEducatio...
Script 2.0.0 Microsoft.Graph.Files {Add-MgDriveListContentTypeCopy, Add-...
Script 2.0.0 Microsoft.Graph.Groups {Add-MgGroupDriveListContentTypeCopy,...
Script 2.0.0 Microsoft.Graph.Identity.Directo... {Confirm-MgContactMemberGroup, Confir...
Script 2.0.0 Microsoft.Graph.Identity.Governance {Add-MgIdentityGovernanceAccessReview...
Script 2.0.0 Microsoft.Graph.Identity.SignIns {Confirm-MgRiskyServicePrincipalCompr...
Script 2.0.0 Microsoft.Graph.Mail {Get-MgUserInferenceClassification, G...
Script 2.0.0 Microsoft.Graph.Notes {Get-MgGroupOnenoteNotebook, Get-MgGr...
Script 2.0.0 Microsoft.Graph.People {Get-MgUserLastSharedMethodInsight, G...
Script 2.0.0 Microsoft.Graph.PersonalContacts {Get-MgUserContact, Get-MgUserContact...
Script 2.0.0 Microsoft.Graph.Planner {Get-MgGroupPlanner, Get-MgGroupPlann...
Script 2.0.0 Microsoft.Graph.Reports {Get-MgAuditLogDirectoryAudit, Get-Mg...
Script 2.0.0 Microsoft.Graph.SchemaExtensions {Get-MgSchemaExtension, Get-MgSchemaE...
Script 2.0.0 Microsoft.Graph.Search {Add-MgExternalConnectionItemActivity...
Script 2.0.0 Microsoft.Graph.Security {Add-MgSecurityCaseEdiscoveryCaseCust...
Script 2.0.0 Microsoft.Graph.Sites {Add-MgSite, Add-MgSiteContentTypeCop...
Script 2.0.0 Microsoft.Graph.Teams {Add-MgChatMember, Add-MgTeamChannelM...
Script 2.0.0 Microsoft.Graph.Users {Get-MgUser, Get-MgUserCount, Get-MgU...
Script 2.0.0 Microsoft.Graph.Users.Actions {Add-MgUserChatMember, Add-MgUserDriv...
Script 2.0.0 Microsoft.Graph.Users.Functions {Export-MgUserDeviceAndAppManagementD...

Environment Data

Name Value


PSVersion 5.1.22000.2003
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22000.2003
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

@ghost ghost added the ToTriage label Jul 7, 2023
@peombwa
Copy link
Member

peombwa commented Jul 7, 2023

Same as #2134 (comment), the command works as expected in the latest version of the SDK:
image

Try running Install-Module Microsoft.Graph -AllowClobber -Force to ensure the latest version of the SDK is installed on your machine, and that the prerequisites stated in the installation guide are met.

@ghost
Copy link

ghost commented Jul 12, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost ghost closed this as completed Jul 15, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants