Set-PnPManagedAppId
SYNOPSIS
Sets or adds an App Id for use with Connect-PnPOnline in the Windows Credential Manager, macOS Keychain, Linux Secret Service, or a default vault configured through Microsoft.PowerShell.SecretManagement.
SYNTAX
Set-PnPManagedAppId -Url <String> -AppId <String> [-Overwrite]
DESCRIPTION
Adds an App Id entry to the Windows Credential Manager, macOS Keychain, Linux Secret Service, or a default vault configured through Microsoft.PowerShell.SecretManagement. PnP PowerShell will check if an App Id is available when you connect using Connect-PnPOnline -Interactive. If it finds a matching URL it will use the associated App Id. You do not need to specify the -ClientId parameter then.
If you add a Credential with a name of "https://yourtenant.sharepoint.com" it will find a match when you connect to "https://yourtenant.sharepoint.com" but also when you connect to "https://yourtenant.sharepoint.com/sites/demo1". Of course you can specify more granular entries, allow you to automatically provide App Ids for different URLs.
EXAMPLES
EXAMPLE 1
Set-PnPManagedAppId -Url "https://tenant.sharepoint.com" -AppId d96c0a07-770d-46f4-bb38-a54084254bf7
This will add an entry for the specified App Id to be use when connecting with Connect-PnPOnline to the URL specified.
PARAMETERS
-Url
The URL to associate the App Id with
Type: String
Parameter Sets: (All)
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Overwrite
Use parameter to overwrite existing macOS Keychain Entry. Not required on Windows or Linux.
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AppId
The App Id to associate with the Url.
Type: String
Parameter Sets: (All)
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False