pnp / cli-microsoft365

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

New command: Add External Connection #2662

Closed kevmcdonk closed 2 years ago

kevmcdonk commented 2 years ago

Usage

This command will allow users to add a new External Connection based on the Microsoft Graph.

search externalconnection add [options]

Description

This command will allow the administrator to create a new external connection for use in Microsoft Search and soon for Viva Topics.

Options

Option Description
-i, --id <id> id of external connection
-n, --name <name> name of external connection
-d, --description <description> name of external connection
-a, --authorisedAppIds [<appId>] collection of App IDs to be added
-o, --output [output] Output type. json,text. Default text
--verbose Runs command with verbose logging
--debug Runs command with debug logging

Additional Information

This is a standard graph command for adding new connections and will be followed up with list and delete.

kevmcdonk commented 2 years ago

Forgot to say that I'm happy to work on this myself!

waldekmastykarz commented 2 years ago

Awesome suggestion and a great spec, thank you @kevmcdonk.

Before you proceed, let's check a few things:

In the future, if there is demand, we could consider extending the command with allowing users to specify apps using their names, which I suspect they'd have readily available comparing to IDs.

Once again, I appreciate the spec and looking forward to your PR.

kevmcdonk commented 2 years ago

Working on the PR for this but realised that it needs additional permissions for listing/adding externalconnections (ExternalConnection.ReadWrite.OwnedBy). Where are these defined for the list of permissions that need to be granted on install?

waldekmastykarz commented 2 years ago

@kevmcdonk we define them in the AAD app that we use for the CLI. For testing you can use a custom AAD app so that you're not blocked. When your PR is ready, we'll review the code and update our AAD app registration.

kevmcdonk commented 2 years ago

Ahhh, now I get it. Perfect, thanks for quick response