New command: m365 pp website webrole remove
Usage
m365 pp website webrole remove [options]
Description
Removes the specified webrole
Options
| Option | Description |
|---|---|
-i, --id <id> |
ID of the webrole to remove. |
--websiteId [websiteId] |
ID of the Power Pages website. Specify either websiteId or websiteName but not both. |
--websiteName [websiteName] |
The unique name (not the display name) of the Power Pages website. Specify either websiteId or websiteName but not both. |
-e, --environmentName <environmentName> |
The name of the environment where the web role is located. |
--asAdmin |
Run the command as admin and retrieve Power Pages websites for environments you do not have explicitly assigned permissions to. |
-f, --force |
Don't prompt for confirmation |
Examples
Deletes webrole 2ca3eaa5-140f-4175-8261-3272edf9f339 from Power Pages website Contoso-Demo in the given environment.
m365 pp website webrole remove --id "2ca3eaa5-140f-4175-8261-3272edf9f339" --websiteName Contoso-Demo --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339"
Deletes a webrole from the selected Power Pages website in the given environment without confirmation prompt.
m365 pp website webrole remove --id "2ca3eaa5-140f-4175-8261-3272edf9f339" --websiteId 2ca3eaa5-140f-4175-8261-3272edf9f339 --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --force
Additional Info
More details here: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/reference/entities/mspp_webrole. In this case the API call would be a DELETE request to ${dynamicsApiUrl}/api/data/v9.2/mspp_webroles(webroleid)
@appieschot awesome job 👏 Here I some things I noticed:
- in the
idoption description you have "Specify either id or name but not both." but we do not have annameoption 🤔. - in description of
websiteIdandwebsiteNameyou refer towebNamebut it should bewebsiteNameright? - the description of the
environmentNamewe could correct to: "The name of the environment where the web role is located."
See, i should copy paste less, thanks for the review, have updated the specs 🙏
May I take this up1
The ID option should be required, no?
Yes, sharp. Updated the specs! I blame the weather for screwing this one up :D
${dynamicsApiUrl}/api/data/v9.2/mspp_webroles(webroleid) does not require a websiteId or websiteName as input. To delete a web role, only the webroleId is necessary. Am i missing anything regarding the API? or Should we remove the websiteid and websitename parameters from this command? Please suggest.
@ktskumar You are right, the API call itself does not require the property. The websiteid property is part of the object (mssp_websiteid) but the reasoning was that a user using the UI typically would navigate to a website to delete the role. When speccing the commend that felt like the appropriate way to do for this command as well.
(I could envision a future release where we update this command to even support deleting webroles by name instead of by ID). My vote is to keep it.