Skip to content

New command: add urlToItem resolver to an external connection #5527

@waldekmastykarz

Description

@waldekmastykarz

Usage

m365 external connection urltoitemresolver add [options]

Description

Adds a URL to item resolver to an external connection

Options

Option Description
-c, --externalConnectionId <externalConnectionId> The ID of the external connection to which to add the resolver
-u, --baseUrls <baseUrls> Comma-separated list of base URLs
--urlPattern <urlPattern> Regex pattern to match URLs
-i, --itemId <itemId> Pattern that matches captured matches from the URL with the external item ID
--priority <priority> Integer that defines the resolution order

Examples

Adds a URL to item resolver to an existing connection:

m365 external connection urltoitemresolver add --connectionId "samplesolutiongallery" --baseUrls "https://adoption.microsoft.com" --urlPattern "/sample-solution-gallery/sample/(?<sampleId>[^/]+)" --itemId "{sampleId}" --priority 1

Default properties

No response

Additional Info

Uses the following endpoint: https://learn.microsoft.com/en-us/graph/api/externalconnectors-externalconnection-update?view=graph-rest-1.0&tabs=http. Requires the external connection to exist.

The body payload needs to be structured as follow:

{
  activitySettings: {
      urlToItemResolvers: [
        {
          '@odata.type': '#microsoft.graph.externalConnectors.itemIdResolver',
          urlMatchInfo: {
            baseUrls: [
              'https://adoption.microsoft.com'
            ],
            urlPattern: '/sample-solution-gallery/sample/(?<sampleId>[^/]+)'
          },
          itemId: '{sampleId}',
          priority: 1
        }
      ]
    }
}

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions