sp-site-designs-studio icon indicating copy to clipboard operation
sp-site-designs-studio copied to clipboard

Add Office 365 CLI Setup script

Open garrytrinder opened this issue 4 years ago • 12 comments

Provide an option for users on non Windows systems to be able to setup the Studio in their tenant.

garrytrinder avatar Jul 22 '20 19:07 garrytrinder

Happy to help out with this one 👍🏻

garrytrinder avatar Jul 22 '20 19:07 garrytrinder

Hello Garry,

I gave it a short try a few weeks ago... but I am definitely not as proficient in bash as in PowerShell. I will push what I already have done. A helping help would indeed be really appreciated :)

Kind regards Yannick

ypcode avatar Jul 22 '20 20:07 ypcode

I will do even better and provide a working PowerShell script using the CLI, then it would be awesome if you can give the translation in bash :)

ypcode avatar Jul 22 '20 21:07 ypcode

Sounds like a deal 👍🏻😁

garrytrinder avatar Jul 22 '20 21:07 garrytrinder

So I was thinking, we could create a script using CLI commands or instead we could look to add a specialist command in the CLI for the setup of this project. Thoughts?

garrytrinder avatar Jul 23 '20 12:07 garrytrinder

Hi @garrytrinder, I think the existing commands should be sufficient. On the other hand, dedicated commands would make it more "promoted" but I don't want to ask you too much effort on this :)

What do you think? I will work on the PowerShell script tomorrow.

ypcode avatar Jul 24 '20 13:07 ypcode

Looking at the script you have for PowerShell, looks like we need a script to replicate the following

  • [ ] Add package to tenant App Catalog
  • [ ] Add WebApiPermissions to Microsoft Graph
  • [ ] Create Communication Site
  • [ ] Deploy app to site
  • [ ] Create Page sds2.aspx
  • [ ] Set page as welcome page
  • [ ] Add web part to page
  • [ ] Create list
  • [ ] Break permission inheritance on list
  • [ ] Add unique permissions
  • [ ] Add links to Global Navigation

Does that cover it all?

garrytrinder avatar Jul 25 '20 10:07 garrytrinder

I think that's it. Take care that it should set the permissions on the preview image library to "everyone except externals" I don't know if there an option in the CLI for that?

ypcode avatar Jul 25 '20 12:07 ypcode

Thanks for clarifying.

If we are missing commands then we can can build them 👍🏻

garrytrinder avatar Jul 25 '20 13:07 garrytrinder

Hi @garrytrinder,

I am writing, as promised, the PowerShell version of the o365 CLI setup script and Indeed some features might be missing (or I am just not sure what command to use if there is one...

The "missing" features would be:

  • add the permissions for the SPFx app e.g. in the PnP Tenant Template, what is corresponding:
        <pnp:WebApiPermissions>
            <pnp:WebApiPermission Resource="Microsoft.Graph" Scope="Directory.AccessAsUser.All"/>
        </pnp:WebApiPermissions>
  • set permissions to the preview images list to everyone except external users
<pnp:Security>
    <pnp:BreakRoleInheritance CopyRoleAssignments="false" ClearSubscopes="false">
        <pnp:RoleAssignment Principal="{associatedmembergroupid}" RoleDefinition="Contribute"/>
        <pnp:RoleAssignment Principal="c:0-.f|rolemanager|spo-grid-all-users/{parameter:TenantId}" RoleDefinition="Read"/>
    </pnp:BreakRoleInheritance>
</pnp:Security>

Your wisdom would be really appreciated here :)

ypcode avatar Jul 30 '20 16:07 ypcode

Hi @garrytrinder , I pushed a draft of the PS1 setup script using the CLI It is here on the dev branch: https://github.com/pnp/sp-site-designs-studio/blob/dev/setup/o365cli/setup-0365.ps1

Related to my previous comment, the are 2 missing steps so far, and it was not really tested, I pushed it only for reference so far. :)

Regards, Yannick

ypcode avatar Jul 31 '20 07:07 ypcode

Thanks @ypcode

Let me create some issues in the CLI repo to cover the missing commands to progress.

garrytrinder avatar Aug 02 '20 20:08 garrytrinder