Skip to main content

v7 Upgrade Guidance

The v7 of CLI for Microsoft 365 introduces several breaking changes. To help you upgrade to the latest version of CLI for Microsoft 365, we've listed those changes along with any actions you may need to take.

Entra ID

Renamed entra o365group commands to entra m365group

In version 7 of the CLI for Microsoft 365, we have renamed all entra o365group commands to entra m365group. It has been some time since Office 365 was renamed to Microsoft 365. Office 365 groups have been named Microsoft 365 groups since then. It was time for CLI for Microsoft 365 to go along with this change.

What action do I need to take?

Replace every entra o365group command with its entra m365group equivalent in your scripts.

Removed deleted flag from certain entra commands

In previous versions of CLI for Microsoft 365, we had a few commands under the Entra group that had a --deleted flag. This flag was used to get deleted users and groups in Entra ID. In this major release, we have removed this flag from the commands. To get all deleted users and groups in your tenant, you should now use different commands.

Affected commands:

Old wayNew way
entra group list --deleted 1entra m365group recyclebinitem list
entra o365group list --deletedentra m365group recyclebinitem list
entra user list --deletedentra user recyclebinitem list

What action do I need to take?

Use the above table to replace the old commands with the new ones in your scripts.

All entra m365group commands now only work with Microsoft 365 groups

Previously using entra m365group commands allowed to retrieve, update, or remove other than just M365 groups. In version 7 of the CLI for Microsoft 365, we added an additional validation that will throw an error when you are using the command against groups that are not unified (Microsoft 365 group).

Affected commands:

What action do I need to take?

If you are using one of the commands listed above, make sure you use them against Microsoft 365 groups.

Power Apps

Removed pa pcf commands

In CLI for Microsoft 365 v7 the following commands were removed:

  • pa pcf init
  • pa solution init
  • pa solution reference add

As the PAC CLI evolved, our implementation of these commands got out of date. Since building Power Apps components is still possible only on Windows and we can't improve the process compared to the PAC CLI, we decided to remove these commands.

What action do I need to take?

Use the PAC CLI to build Power Apps components and solutions.

Power Automate

Updated output for certain flow commands

In this major release of CLI for Microsoft 365, we have made an enhancement for the data returned by certain flow commands. In previous versions, when no items were found, the commands gave no output. This made these commands very unpredictable to use in scripts. This has now been changed so an empty array will be used as output when no items are found.

Besides that, when using JSON output, we had duplicate properties in the result. These redundant properties have now been removed.

Affected commands:

What action do I need to take?

  • Make sure that your scripts expect an empty array instead of no output when no results are found.
  • When you are expecting a JSON output, make sure to recheck the response, few duplicate properties have been removed.

Power Platform

Updated output of pp chatbot list

The output of pp chatbot list contained a displayName property. However, the actual property coming from the API was called name. We changed displayName back to name so that it now aligns with the other chatbot commands where a name option can be used and a name property may be returned.

What action do I need to take?

If you use the displayName property from the command output in your scripts, expect a property called name instead.

SharePoint

Updated spo file move, spo folder copy, and spo folder move options

Nearly all commands to move and copy files and folders in SharePoint online have been updated. In v6 we already updated the spo file copy command to use a new endpoint. This major release it was time for the other copy and move commands to follow. The improved functionality supports copying moving files with # and % chars in their name. When you specify an URL for options webUrl, sourceUrl, and targetUrl, make sure that you specify a decoded URL.

Because of this rework, we were able to add new options, but we also had to remove existing ones.

Affected commands:

Removed options:

  • --deleteIfAlreadyExists
  • --allowSchemaMismatch

What action do I need to take?

Update your scripts to use the new options. Verify that your scripts work as intended.

  • Ensure all the URLs you provide are decoded.
  • Remove the option --allowSchemaMismatch, this is the default behavior now.
  • Replace option --deleteIfAlreadyExists with --nameConflictBehavior replace.

Removed deleted flag from spo site list command

In the previous versions of CLI for Microsoft 365, you could get deleted sites from your SharePoint tenant using the command spo site list by providing the flag --deleted. In the latest release, we have removed this option from the command. To get all deleted sites in your tenant, you can now use the command spo tenant recyclebinitem list.

What action do I need to take?

In your scripts, use the spo tenant recyclebinitem list command instead of spo site list --deleted.

Removed ID property from certain outputs

When retrieving certain SharePoint objects, such as list items, the response contained two ID properties: ID and Id. This is the way SharePoint returns the data. In version 7 of the CLI for Microsoft 365, we have removed the ID property from the response. This to make it easier to convert the JSON response to for example a PowerShell object. Because JSON parsing in PowerShell is case-insensitive, this would result in an error.

The ID property has been removed for the following commands:

What action do I need to take?

If you are using one of the affected commands listed above, make sure to update your scripts to use the Id property instead of ID.

Removal of deprecated command aliases

In version 7 of the CLI for Microsoft 365, we have removed deprecated command aliases. These aliases were introduced in the previous version to prevent the introduction of breaking changes. The following table lists the deprecated aliases and their replacements.

Deprecated aliasReplacement
spo list label getspo list retentionlabel get
spo list label setspo list retentionlabel ensure

What action do I need to take?

Update your scripts to use the new commands instead of the deprecated aliases.

Updated spo theme list command output

In version 7 of the CLI For Microsoft 365, we have made an adjustment for the data returned by the command spo theme list. Previously, when no items were found, the command had no output. This made this command very unpredictable to use in scripts. The command has now been updated so an empty array will be used as output when no items are found.

What action do I need to take?

Make sure that your script expects an empty array when there are no themes found.

Removed option schemaXml for spo list commands

In this version of the CLI for Microsoft 365, the option schemaXml has been removed for the spo list add and spo list set commands. This option was used to specify the list schema XML when creating a list. This option has been removed as it is no longer supported by Microsoft 365.

What action do I need to take?

Remove the references to the option schemaXml from your scripts. Verify that your scripts work as intended.

Updated spo tenant commandset set command with more options

In previous versions of CLI for Microsoft 365, to update a ListView Command Set, you could only specify option id using the command spo tenant commandset set. In this release, we have expanded the feature so that you can also update existing ListView Command Sets using either id, title, or clientSideComponentId.

What action do I need to take?

Because option id was mandatory in v6, if your scripts are dependent on the default mandatory error output that the command would return, you may have to update your scripts accordingly.

Removed deprecated options for spo list retentionlabel ensure command

In this version of the CLI for Microsoft 365, we have removed the options label, blockDelete, and blockEdit from the spo list retentionlabel ensure command. Both options blockDelete and blockEdit were currently being ignored even though they were set when calling the command. The option label has been removed to match our naming conventions.

What action do I need to take?

Remove the references to the option blockDelete and blockEdit from commands and replace the option label to name in scripts.

Updated spo tenant applicationcustomizer get id property to list item id

In version 7 of the CLI for Microsoft 365, the id option of spo tenant applicationcustomizer get has been updated. As of this release, it should be the list item ID instead of the product ID (GUID).

What action do I need to take?

Update your scripts to use the list item ID for the id option instead of the UniqueId product ID.

Teams

Updated teams meeting list command output

In the past versions of CLI for Microsoft 365, the command teams meeting list returned Outlook calendar objects as a result. Because of this, the IDs displayed in the output were not the same as the IDs used in other teams meeting commands. This problem has been solved in v7. We have updated the output of the command to return Teams meeting objects instead of Outlook calendar objects. This means that the IDs displayed in the output are now the same as the IDs used in the other teams meeting commands.

Click here to compare the different command outputs
[
{
"id": "AAMkADgzN2Q1NThiLTI0NjYtNGIxYS05MDdjLTg1OWQxNzgwZGM2ZgBGAAAAAAC6jQfUzacTSIHqMw2yacnUBwBiOC8xvYmdT6G2E_hLMK5kAAAAAAENAABiOC8xvYmdT6G2E_hLMK5kAAIw3TQIAAA=",
"createdDateTime": "2022-06-26T12:39:34.224055Z",
"lastModifiedDateTime": "2022-06-26T12:41:36.4357085Z",
"changeKey": "YjgvMb2JnU+hthPoSzCuZAACMHITIQ==",
"categories": [],
"transactionId": null,
"originalStartTimeZone": "W. Europe Standard Time",
"originalEndTimeZone": "W. Europe Standard Time",
"iCalUId": "040000008200E00074C5B7101A82E008000000001AF70ACA5989D801000000000000000010000000048716A892ACAE4DB6CC16097796C401",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Test meeting",
"bodyPreview": "________________________________________________________________________________\r\\\nMicrosoft Teams meeting\r\\\nJoin on your computer or mobile app\r\\\nClick here to join the meeting\r\\\nLearn More | Meeting options\r\\\n___________________________________________",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkADgzN2Q1NThiLTI0NjYtNGIxYS05MDdjLTg1OWQxNzgwZGM2ZgBGAAAAAAC6jQfUzacTSIHqMw2yacnUBwBiOC8xvYmdT6G2E%2BhLMK5kAAAAAAENAABiOC8xvYmdT6G2E%2BhLMK5kAAIw3TQIAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl": null,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness",
"allowNewTimeProposals": true,
"occurrenceId": null,
"isDraft": false,
"hideAttendees": false,
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "<html>\r\\\n<head>\r\\\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\\\n</head>\r\\\n<body>\r\\\n<div><br>\r\\\n<br>\r\\\n<br>\r\\\n<div style=\"width:100%; height:20px\"><span style=\"white-space:nowrap; color:#5F5F5F; opacity:.36\">________________________________________________________________________________</span>\r\\\n</div>\r\\\n<div class=\"me-email-text\" lang=\"en-US\" style=\"color:#252424; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\\\n<div style=\"margin-top:24px; margin-bottom:20px\"><span style=\"font-size:24px; color:#252424\">Microsoft Teams meeting</span>\r\\\n</div>\r\\\n<div style=\"margin-bottom:20px\">\r\\\n<div style=\"margin-top:0px; margin-bottom:0px; font-weight:bold\"><span style=\"font-size:14px; color:#252424\">Join on your computer or mobile app</span>\r\\\n</div>\r\\\n<a href=\"https://teams.microsoft.com/l/meetup-join/19%3ameeting_OWIwM2MzNmQtZmY1My00MzM0LWIxMGQtYzkyNzI3OWU5ODMx%40thread.v2/0?context=%7b%22Tid%22%3a%22e1dd4023-a656-480a-8a0e-c1b1eec51e1d%22%2c%22Oid%22%3a%22fe36f75e-c103-410b-a18a-2bf6df06ac3a%22%7d\" class=\"me-email-headline\" style=\"font-size:14px; font-family:'Segoe UI Semibold','Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; text-decoration:underline; color:#6264a7\">Click\r\\\n here to join the meeting</a> </div>\r\\\n<div style=\"margin-bottom:24px; margin-top:20px\"><a href=\"https://aka.ms/JoinTeamsMeeting\" class=\"me-email-link\" style=\"font-size:14px; text-decoration:underline; color:#6264a7; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">Learn More</a>\r\\\n | <a href=\"https://teams.microsoft.com/meetingOptions/?organizerId=fe36f75e-c103-410b-a18a-2bf6df06ac3a&amp;tenantId=e1dd4023-a656-480a-8a0e-c1b1eec51e1d&amp;threadId=19_meeting_OWIwM2MzNmQtZmY1My00MzM0LWIxMGQtYzkyNzI3OWU5ODMx@thread.v2&amp;messageId=0&amp;language=en-US\" class=\"me-email-link\" style=\"font-size:14px; text-decoration:underline; color:#6264a7; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\\\nMeeting options</a> </div>\r\\\n</div>\r\\\n<div style=\"font-size:14px; margin-bottom:4px; font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif\">\r\\\n</div>\r\\\n<div style=\"font-size:12px\"></div>\r\\\n</div>\r\\\n<div style=\"width:100%; height:20px\"><span style=\"white-space:nowrap; color:#5F5F5F; opacity:.36\">________________________________________________________________________________</span>\r\\\n</div>\r\\\n<div></div>\r\\\n</body>\r\\\n</html>\r\\\n"
},
"start": {
"dateTime": "2022-06-26T12:30:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2022-06-26T13:00:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "",
"locationType": "default",
"uniqueIdType": "unknown",
"address": {},
"coordinates": {}
},
"locations": [],
"recurrence": null,
"attendees": [
{
"type": "required",
"status": {
"response": "none",
"time": "0001-01-01T00:00:00Z"
},
"emailAddress": {
"name": "User D",
"address": "userD@outlook.com"
}
}
],
"organizer": {
"emailAddress": {
"name": "User",
"address": "user@tenant.com"
}
},
"onlineMeeting": {
"joinUrl": "https://teams.microsoft.com/l/meetup-join/19%3ameeting_OWIwM2MzNmQtZmY1My00MzM0LWIxMGQtYzkyNzI3OWU5ODMx%40thread.v2/0?context=%7b%22Tid%22%3a%22e1dd4023-a656-480a-8a0e-c1b1eec51e1d%22%2c%22Oid%22%3a%22fe36f75e-c103-410b-a18a-2bf6df06ac3a%22%7d"
}
}
]

What action do I need to take?

Update your scripts to expect the new output output displayed above.

General

Renamed option confirm to force in all commands

When doing destructive things like deleting a site, CLI for Microsoft 365 asks you to confirm your intention. In version 7 of the CLI for Microsoft 365, we have renamed the option confirm to force in all commands. This change aims to be more consistent with other CLI tools where force is used to suppress warnings.

What action do I need to take?

Update your scripts to use the new flag --force instead of --confirm for destructive commands.

Aligned options with the naming convention

In version 7 of the CLI for Microsoft 365, we have made updates to the options for specific commands, aligning with our naming convention. This includes renaming options to ensure consistency and improve the CLI experience. Some other options have been renamed to align with the response output of the commands. These changes aim to make it easier for you to use the CLI.

We've updated the following commands and options:

CommandOld optionNew option
entra app seturiuris
entra approleassignment addscopescopes
entra approleassignment removescopescopes
entra group gettitledisplayName
entra user setobjectIdid
entra user setuserPrincipalNameuserName
flow connector exportconnectorname
flow exportidname
graph subscription addchangeTypechangeTypes
pa app consent setenvironmentenvironmentName
pa app exportenvironmentenvironmentName
pa app exportidname
pa app exportn (short)packageDisplayName
pa app listenvironmentenvironmentName
pa connector exportconnectorname
pp aibuildermodel getenvironmentenvironmentName
pp aibuildermodel listenvironmentenvironmentName
pp aibuildermodel removeenvironmentenvironmentName
pp card cloneenvironmentenvironmentName
pp card getenvironmentenvironmentName
pp card listenvironmentenvironmentName
pp card removeenvironmentenvironmentName
pp chatbot getenvironmentenvironmentName
pp chatbot listenvironmentenvironmentName
pp chatbot removeenvironmentenvironmentName
pp dataverse table getenvironmentenvironmentName
pp dataverse table listenvironmentenvironmentName
pp dataverse table removeenvironmentenvironmentName
pp dataverse table row listenvironmentenvironmentName
pp dataverse table row removeenvironmentenvironmentName
pp solution getenvironmentenvironmentName
pp solution listenvironmentenvironmentName
pp solution removeenvironmentenvironmentName
pp solution publishenvironmentenvironmentName
pp solution publisher addenvironmentenvironmentName
pp solution publisher getenvironmentenvironmentName
pp solution publisher listenvironmentenvironmentName
pp solution publisher removeenvironmentenvironmentName
spo file getw (short)u (short)
spo file getu (short)url
spo file listfolderfolderUrl
spo file removew (short)u (short)
spo file removeu (short)url
spo file version clearw (short)u (short)
spo file version clearu (short)fileUrl
spo file version getw (short)u (short)
spo file version getu (short)fileUrl
spo file version listw (short)u (short)
spo file version listu (short)fileUrl
spo file version removew (short)u (short)
spo file version removeu (short)fileUrl
spo file version restorew (short)u (short)
spo file version restoreu (short)fileUrl
spo group member adduserNameuserNames
spo group member addemailemails
spo group member adduserIduserIds
spo group member addaadGroupIdaadGroupIds
spo group member addaadGroupNameaadGroupNames
spo group member addemailemails
spo group member adduserIduserIds
spo group member adduserNameuserNames
spo listitem attachment listitemIdlistItemId
teams channel member adduserDisplayNameuserDisplayNames
teams channel member adduserIduserIds

What action do I need to take?

If you use any of the commands listed above, ensure that you use the new option names.

Footnotes

  1. Note that only Microsoft 365 groups can go to the recycle bin of your tenant. Therefore this command did exactly the same as its m365group equivalent.

CTRL + M