import Global from '../../_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# external connection urltoitemresolver add

Adds a URL to item resolver to an external connection

## Usage

```sh
m365 external connection urltoitemresolver add [options]
```

## Options

```md definition-list
`-c, --externalConnectionId <externalConnectionId>`
: The ID of the external connection to which to add the resolver

`--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

`-p, --priority <priority>`
: Integer that defines the resolution order
```
<Global />

## Permissions

<Tabs>
  <TabItem value="Delegated">

  | Resource        | Permissions                          |
  |-----------------|--------------------------------------|
  | Microsoft Graph | ExternalConnection.ReadWrite.OwnedBy |

  </TabItem>
  <TabItem value="Application">

  | Resource        | Permissions                          |
  |-----------------|--------------------------------------|
  | Microsoft Graph | ExternalConnection.ReadWrite.OwnedBy |

  </TabItem>
</Tabs>

## Examples

Adds a URL to item resolver to an existing connection

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

## Response

The command won't return a response on success.

## More information

- Microsoft Graph external connection activitySettings: [https://learn.microsoft.com/graph/api/resources/externalconnectors-activitysettings?view=graph-rest-1.0](https://learn.microsoft.com/graph/api/resources/externalconnectors-activitysettings?view=graph-rest-1.0)
