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

New command: m365 spe containertype add #5767

Closed
Adam-it opened this issue Jan 9, 2024 · 11 comments
Closed

New command: m365 spe containertype add #5767

Adam-it opened this issue Jan 9, 2024 · 11 comments

Comments

@Adam-it
Copy link
Contributor

Adam-it commented Jan 9, 2024

Usage

m365 spe containertype add [options]

Description

Creates a new Container Type for your app

Options

Option Description
-n, --name <name> Container type name.
--applicationId <applicationId> Application (client) ID of the Azure AD (Entra ID) app that will be the owner of the container type.
--trial Specify if the container type should be a trial.
--azureSubscriptionId [azureSubscriptionId] Azure Subscription Id. Required unless on a trial.
--resourceGroup [resourceGroup] Azure Resource group for billing. Required unless on a trial.
--region [region] Region. Required unless on a trial.

Examples

Adds a new trial container type

m365 spe containertype add --name 'trial container' --applicationId '1b3b8660-9a44-4a7c-9c02-657f3ff5d5ac' --trial

Default properties

No response

Additional Info

We may use CSOM for this command passing the following

<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="SharePoint Online PowerShell (16.0.24322.0)"
    xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
    <Actions>
        <ObjectPath Id="4" ObjectPathId="3" />
        <Method Name="NewSPOContainerType" Id="5" ObjectPathId="3">
            <Parameters>
                <Parameter TypeId="{5466648e-c306-441b-9df4-c09deef25cb1}">
                    <Property Name="AzureSubscriptionId" Type="Guid">{00000000-0000-0000-0000-000000000000}</Property>
                    <Property Name="ContainerTypeId" Type="Guid">{00000000-0000-0000-0000-000000000000}</Property>
                    <Property Name="CreationDate" Type="Null" />
                    <Property Name="DisplayName" Type="String">testTrail</Property>
                    <Property Name="ExpiryDate" Type="Null" />
                    <Property Name="IsBillingProfileRequired" Type="Boolean">false</Property>
                    <Property Name="OwningAppId" Type="Guid">{1b3b8660-9a44-4a7c-9c02-657f3ff5d5ac}</Property>
                    <Property Name="OwningTenantId" Type="Guid">{00000000-0000-0000-0000-000000000000}</Property>
                    <Property Name="Region" Type="Null" />
                    <Property Name="ResourceGroup" Type="Null" />
                    <Property Name="SPContainerTypeBillingClassification" Type="Enum">1</Property>
                </Parameter>
            </Parameters>
        </Method>
    </Actions>
    <ObjectPaths>
        <Constructor Id="3" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" />
    </ObjectPaths>
</Request>

we should add in command docs info or link to the docs explaining what is a trial container type and it's limits
https://learn.microsoft.com/en-us/sharepoint/dev/embedded/concepts/app-concepts/containertypes#sharepoint-embedded-trial-container-types

we should also provide a link to the container type docs https://learn.microsoft.com/en-us/sharepoint/dev/embedded/concepts/app-concepts/containertypes

expected output of the command should be something like

Container Type ID:
===============================================================================
ContainerTypeId     : 3a6b1fc4-0bd9-04b3-3a2a-4843fbb60914
ContainerTypeName   : FirstContainerType
OwningApplicationId : 763cd5ea-ade4-4d2a-a143-29498920e18f
Classification      : Standard
AzureSubscriptionId : 00000000-0000-0000-0000-000000000000
ResourceGroup       :
Region              :
@Adam-it Adam-it added new feature needs peer review Needs second pair of eyes to review the spec or PR labels Jan 9, 2024
@Jwaegebaert
Copy link
Contributor

Generally, this looks alright @Adam-it but the option descriptions aren't very clear yet. I would suggest something like this:

Option Description
-n, --name <name> Container type name.
--applicationId <applicationId> Application ID of the Azure AD app that will be the owner of the container type.
--trial Specify if the container type should be a trial.
--azureSubscriptionId [azureSubscriptionId] Azure Subscription Id. Required unless on a trail.
--resourceGroup [resourceGroup] Azure Resource group for billing. Required unless on a trail.
--region [region] Region. Required unless on a trail.

A bit of clarification, looking at the documentation. Trial doesn't look like a type that should be used too often. That's why I removed the short for it and you won't submit this option with any value so [trial] can be dropped.

One option that lacks clarity and lacks a well-documented explanation is --region. What should this entail?

@Adam-it
Copy link
Contributor Author

Adam-it commented Jan 10, 2024

Thanks @Jwaegebaert for your comments 👍.

  • For the --applicationId <applicationId> I think here we should use Azure AD (Entra ID) naming and also I would add the Client Id somewhere, maybe like Application (Client) ID of the Azure AD (Entra ID) app that will be the owner of the container type. as it brings even more clarity and is aligned with the AAD (Entra ID) UX as well. What do you think?
    image

  • as for the trail your totally right. This should be a flag and indeed it you may have only one trail container per tenant. Its valid only for 30 days and allows 1 GB storage. So it's purpose is more to play around and check what is possible. Hard to say if it should be used often 🤔 For sure not if you are thinking of a production app 😅😉.

  • as for the region, as far as I am aware this should be one of the possible Azure regions you are allowed (obligated) to select when creating almost any kind of Azure Resource and as far as I am aware you are able to provide it as a string by region name. Although I could be wrong and maybe we could as @andrewconnell for a bit of expertise feed on this one 🙏🙂. I am not sure how to add more clarity to this description TBH 🤔.
    image

@Adam-it
Copy link
Contributor Author

Adam-it commented Jan 10, 2024

@Jwaegebaert I aligned the spec according to your comment 👍

@andrewconnell
Copy link
Contributor

@Adam-it said:

as for the region, as far as I am aware this should be one of the possible Azure regions you are allowed (obligated) to select when creating almost any kind of Azure Resource and as far as I am aware you are able to provide it as a string by region name. Although I could be wrong and maybe we could as @andrewconnell for a bit of expertise feed on this one 🙏🙂. I am not sure how to add more clarity to this description TBH 🤔.

To the best of my knowledge, there's no limit on Azure region. Maybe there is with the public preview, but I haven't seen anything like that.

The Azure subscription & resource group is only used because it's set up for metered billing whereas M365 is not. IOW, it's just a way for M365 to link to your CC

@waldekmastykarz
Copy link
Member

Looks good @Adam-it. No further comments

@Adam-it Adam-it added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels Jan 12, 2024
@Jwaegebaert
Copy link
Contributor

Nice work @Adam-it, only region is still lacking a bit of information but besides that, it looks good to go.

@MathijsVerbeeck
Copy link
Contributor

Can I work on this?

@Jwaegebaert
Copy link
Contributor

@MathijsVerbeeck, are you still working on this?

@MathijsVerbeeck
Copy link
Contributor

@MathijsVerbeeck, are you still working on this?

Yes. I'm currently finalizing the response handling :) It takes quite some research as it's not really documented at the moment by Microsoft.

@andrewconnell
Copy link
Contributor

@MathijsVerbeeck said

It takes quite some research as it's not really documented at the moment by Microsoft.

If you have trouble figuring something out, ping me... I'm doing a bunch of work with the SPE team and can lean on those resources if it helps.

@Adam-it Adam-it changed the title New command: m365 spe container type add New command: m365 spe containertype add Apr 6, 2024
@Adam-it
Copy link
Contributor Author

Adam-it commented Apr 6, 2024

@MathijsVerbeeck sorry for the late update.
Due to last discussion we had we will be updating the name of this command to containertype instead of container type.
Sorry for such a late update on this 🙏. We are just taking first steps with SPE in CLI and we are still researching how to go about it properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants