microsoftgraph / msgraph-sdk-powershell

Powershell SDK for Microsoft Graph
https://www.powershellgallery.com/packages/Microsoft.Graph
Other
711 stars 171 forks source link

New-MgApplicationTemplate #1700

Closed AFK-Python closed 1 year ago

AFK-Python commented 1 year ago

I was trying to create an application template (by using this documentation page) for my needs regarding the automation of SAML-based single sign-on for an application (see this tutorial).

However, when running the command New-MgApplicationTemplate, I get the following error:

Line |
  55 |  $appTemplate = New-MgApplicationTemplate -DisplayName $displayName `
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | POST is not supported for the requested target.

I'm confused as to why this occurs. Is this behavior intentional? If it is, why does this cmdlet exist? Happy to add anymore info.

peombwa commented 1 year ago

The service does not support creation of application templates. See supported method at https://learn.microsoft.com/en-us/graph/api/resources/applicationtemplate?view=graph-rest-1.0#methods.

The service instead supports instantiate method (creating an instance of an application from the Azure AD application gallery into your directory) via Invoke-MgInstantiateApplicationTemplate - https://learn.microsoft.com/en-us/graph/api/applicationtemplate-instantiate?view=graph-rest-1.0&tabs=powershell.

Unfortunately, New-MgApplicationTemplate exists because it is described as supported in the service metadata that the module is generated from. This will need to be corrected by the API owner.

AFK-Python commented 1 year ago

I see, thank you for the rapid response. From what I've been playing around with it does seem I can edit the details to my use case from the template's starting values. Good enough I guess.

peombwa commented 1 year ago

You are welcome.

I would also recommend you open a service feature request at https://developer.microsoft.com/en-us/graph/support for your scenario to be added to the API.

I've transferred the issue to the metadata repo - https://github.com/microsoftgraph/msgraph-metadata/issues/236.