import Global from '../../_global.mdx';

# spo applicationcustomizer add

Add an Application Customizer to a site

## Usage

```sh
m365 spo applicationcustomizer add [options]
```

## Options

```md definition-list
`-t, --title <title>`
: The title of the Application Customizer.

`-u, --webUrl <webUrl>`
: URL of the site.

`-i, --clientSideComponentId <clientSideComponentId>`
: Client-side component ID of the Application Customizer (GUID).

`--description [description]`
: Description of the Application Customizer.

`--clientSideComponentProperties [clientSideComponentProperties]`
: JSON string with Application Customizer properties.

`--hostProperties [hostProperties]`
: Set the host properties of the Application Customizer.

`-s, --scope [scope]`
: Scope of the Application Customizer. Allowed values: `Site`, `Web`. Defaults to `Site`.
```

<Global />

## Remarks

Running this command from the Windows Command Shell (cmd.exe) or PowerShell for Windows OS XP, 7, 8, 8.1 without bash installed might require additional formatting for command options that have JSON, XML or JavaScript values because the command shell treats quotes differently. For example, this is how an Application Customizer can be created from the Windows cmd.exe:

```sh
m365 spo applicationcustomizer add --webUrl https://contoso.sharepoint.com/sites/test --title "YourAppCustomizer" --clientSideComponentId b41916e7-e69d-467f-b37f-ff8ecf8f99f2 --clientSideComponentProperties '{\"testMessage\":\"Test message\"}'
```

Note, how the clientSideComponentProperties option has escaped double quotes `'{\"testMessage\":\"Test message\"}'` compared to execution from bash `'{"testMessage":"Test message"}'`.

:::warning[Escaping JSON in PowerShell]

When using the `--clientSideComponentProperties` or `--hostProperties` options it's possible to enter a JSON string. In PowerShell 5 to 7.2 [specific escaping rules](./../../../user-guide/using-cli.mdx#escaping-double-quotes-in-powershell) apply due to an issue. Remember that you can also use [file tokens](./../../../user-guide/using-cli.mdx#passing-complex-content-into-cli-options) instead.

:::

This command can be used for configuring an Application Customizer on a specific site. To configure an Application Customizer tenant-wide, view our dedicated [spo tenant applicationcustomizer add](../tenant/tenant-applicationcustomizer-add.mdx) command.

## Examples

Adds an Application Customizer to the sales site.

```sh
m365 spo applicationcustomizer add --title 'Some customizer' --clientSideComponentId 799883f5-7962-4384-a10a-105adaec6ffc --webUrl https://contoso.sharepoint.com/sites/sales
```

Adds an Application Customizer to the sales site with some properties.

```sh
m365 spo applicationcustomizer add --title 'Some customizer' --clientSideComponentId 799883f5-7962-4384-a10a-105adaec6ffc --clientSideComponentProperties '{ "someProperty": "Some value" }' --webUrl https://contoso.sharepoint.com/sites/sales --scope 'Site'
```

## Response

The command won't return a response on success.
