Skip to content

New command: pa app owner set #4646

@milanholemans

Description

@milanholemans

Usage

m365 pa app owner set [options]

Description

Sets a new owner for a Power Apps app

Options

Option Description
-e, --environmentName <environmentName> The name of the environment.
--appName <appName> The name (GUID) of the Microsoft Power App.
--userId [userId] The ID of the new owner. Specify either userId or userName but not both.
--userName [userName] User principal name of new owner. Specify either userId or userName but not both.
--roleForOldAppOwner [roleForOldAppOwner] Grant permissions for the previous owner. Allowed values: CanView, CanEdit. Don't specify a value to remove the previous owner from the app.

Examples

Set a new owner for a Power Apps app and make the previous owner co-owner

m365 pa app owner set --environmentName Default-716eb9fb-bf79-4be9-b0c7-900824fcbe25 --apName 7ab97923-4a4d-4467-b030-12071d2b810b --userId c6ee6ed4-0172-4fdc-87a3-cfd9c324de1d --roleForOldAppOwner CanEdit

Set a new owner for a Power Apps app and remove the previous owner

m365 pa app owner set --environmentName Default-716eb9fb-bf79-4be9-b0c7-900824fcbe25 --apName 7ab97923-4a4d-4467-b030-12071d2b810b --userName [email protected]

Default properties

API request

POST https://api.powerapps.com/providers/Microsoft.PowerApps/scopes/admin/environments/<environment>/apps/<appName>/modifyAppOwner?api-version=2022-11-01

{
    "roleForOldAppOwner": "CanEdit",
    "newAppOwner": "<User ID>"
}

Specify undefined as roleForOldAppOwner to remove the previous owner.

Additional Info

Docs admonition

  • You must have admin permissions to run this command (not sure which admin role)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions