Assign a user to an environment
cs_admin_assign_userAssign a security role to a user or application user in a specified environment, requiring explicit confirmation to apply changes to a live environment.
Instructions
Give a user (or an application user) a security role in an environment. Changes a live environment: requires confirm: true. Runs 'pac admin assign-user' with the active pac auth profile. Mutates a live environment: requires confirm: true (a dry run otherwise).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for pac (for project commands: the solution project folder) | |
| role | Yes | Security role name or id (cs_admin_list_security_roles) | |
| user | Yes | Object id or UPN, or the application id for an application user | |
| confirm | No | Required to actually perform a change in a live environment. Without it the tool returns a dry run. | |
| profile | No | pac auth profile to run as: the admin account for tenant commands. Defaults to CPS_ADMIN_PROFILE for admin commands and CPS_PAC_PROFILE otherwise, then the active profile. cs_init lists the profiles. | |
| background | No | Run in the background and return a jobId immediately, for a command that takes longer than the client will wait. Poll cs_job_status. | |
| environment | No | Environment id or URL | |
| businessUnit | No | Business unit id | |
| timeoutSeconds | No | Default 600 | |
| applicationUser | No | The user is an application (service principal) |