pnp / cli-microsoft365

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

Extend the `m365 spe containertype add` with more options to specify application #5990

Open Adam-it opened 2 months ago

Adam-it commented 2 months ago

in issue #5767 We added a new command m365 spe containertype add that allows only to specify the parent application by applicationId. What we could do is extend this command with new options: applicationName and applicationObjectId. This will allow a more user friendly approach to define new Container Type using names rather than guids.

Internally what we could do is try to resolve the app by name. If more than one will be found CLI should show a prompt (when interactive mode) to pick the correct app by id. After CLI will get the app by name or object id we should use the app id (client id) to create a new Container Type

arenk commented 2 months ago

I'll leave this comment here since there was a discussion on the region parameter in #5767 (already closed).

To my knowledge, the region must support Microsoft.Syntex - far less options than what is offered when you create a new resource group.

-> it might make sense to update the docs when working on this functionality again.

This is the error message I got when I tried to use germanywestcentral as region parameter:

The provided location 'germanywestcentral' is not available for resource type 'Microsoft.Syntex/accounts'. List of available regions for the resource type is 'eastus,centralus,westcentralus,westus,southcentralus, northcentralus,eastus2,canadacentral,canadaeast,brazilsouth,northeurope,norwayeast,norwaywest,francecentral,francesouth,switzerlandnorth,switzerlandwest,uksouth,ukwest,germanynorth,westeurope,australiaeast,australiasoutheast,centralindia,southindia,westindia,eastasia,southeastasia,japaneast,koreacentral,uaenorth,southafricanorth,southafricawest'."}}.

Adam-it commented 2 months ago

@arenk good tip. I was not aware of that either 👍. I will research this a bit and lets include it in the docs so it will be clear for others in future

arenk commented 2 months ago

Maybe a few more details: For each container type, a Microsoft Syntex account will be created within the resource group specified in the resource group parameter. One can see the Syntex account in the resource group overview in the Azure portal if "Show hidden types" is enabled. I assume this account is then used for billing purposes.

I've been successful in creating a container type where the location of the resource group does not match the region of the Syntex account (for example, that is currently required in Germany, since I can create resource groups for germanywestcentral only, but Syntex is only available in germanynorth).

This is all just based on my observations, not on official docs 😃

Adam-it commented 3 weeks ago

@pnp/cli-for-microsoft-365-maintainers what @arenk suggested I think is very valid and we could also added to our docs for the SPE commands. I would probably suggest we add something generic like region needs to available for resource type 'Microsoft.Syntex/accounts' I would not list out the regions as the list and it will be hard to keep track of it and maintain. Any feed?

Jwaegebaert commented 1 week ago

Adding a remark is a good start. It might be worth keeping an eye on MS docs to see if they list them, so we can link there easily.