pnp / cli-microsoft365

Manage Microsoft 365 and SharePoint Framework projects on any platform
https://aka.ms/cli-m365
MIT License
910 stars 318 forks source link

Enhancement: add optional parameter to specify a folder in the app catalog for `m365 spo app add` #6364

Open michaelmaillot opened 2 weeks ago

michaelmaillot commented 2 weeks ago

Currently, SPFx solutions are deployed at the root of an app catalog, whether it's a tenant or a site collection one.

The idea is to add a new command option to specify a folder because in some organizations, there's only one tenant for the whole company, including the subsidiaries. In that case, permissions can be setup to not expose an app to everyone but only one subsidiary.

Property description idea:

Option Description
--catalogFolderPath [catalogFolderPath] Relative path in the tenant or site collection app catalog to add the package file. If not provided, the package file will be added to the root folder of the app catalog.
Jwaegebaert commented 1 week ago

That's a great feature request. Thanks for submitting this @michaelmaillot!

Looks good to go for me. @pnp/cli-for-microsoft-365-maintainers any further remarks before opening it up?

milanholemans commented 1 week ago

Nice suggestion. Maybe for consistency, we should call it appCatalogFolderUrl. Let's also check if we need something similar for other app commands like spo app get.

waldekmastykarz commented 1 week ago

Before we do, let's double check if using folders in the app catalog is a supported scenario and we're not trying to promote something that's officially shouldn't be done (even though it's working).

@VesaJuvonen do we officially support creating folders and uploading solutions to folders in the app catalog?

VesaJuvonen commented 1 week ago

@waldekmastykarz - that's a really good question. We have not really considered the scenario at this level, but technically that should work as file is still in the catalog and this will provide proper level of grouping between the solutions if there are a lot of solutions. Let me run this through with few people internally to avoid surprises.

michaelmaillot commented 1 week ago

Thanks for your feedback @VesaJuvonen & @waldekmastykarz.

TBH I actually met this scenario and I was the first surprised that it was actually possible. And the only thing that changes from "regular" usage of tenant app catalog is that if you set specific permissions on a folder, only people that have (read) access will be able to see apps inside, when they will browse through the org app store. But this won't impact installed ones (since compiled files are located in the clientSideAssets library).