Description
Unable to create an AD App from a manifest file using the m365 aad app add command. I'm sure I'm doing something wrong, Looking for guidance on how to move forward.
Steps to reproduce
- In the Azure Portal, create an AD App with the default settings and some name.
- Navigate to that app and download the manifest file
- Update the name of the app within the manifest to something unique
- Run these commands from the same location the file was created in
$json= Get-Content 'testmanifest.json'
m365 aad app add --manifest $json
Expected results
App should be created in the Azure Tenant with the specified name
Actual results
Error running script:
Error: Error while parsing the specified manifest: SyntaxError: Unexpected token a in JSON at position 3
Diagnostics
Error: Error while parsing the specified manifest: SyntaxError: Unexpected token a in JSON at position 3
CLI for Microsoft 365 version
v5.1.0
nodejs version
v16.14.2
Operating system (environment)
Windows
Shell
PowerShell
cli doctor
{
"os": {
"platform": "win32",
"version": "Windows 10 Enterprise",
"release": "10.0.19042"
},
"cliVersion": "5.1.0",
"nodeVersion": "v16.14.2",
"cliAadAppId": "31359c7f-bd7e-475c-86db-fdb8c937548e",
"cliAadAppTenant": "common",
"authMode": "DeviceCode",
"cliEnvironment": "",
"cliConfig": {},
"roles": [],
"scopes": [
"AllSites.FullControl",
"AppCatalog.ReadWrite.All",
"AuditLog.Read.All",
"ChannelMember.ReadWrite.All",
"ChannelMessage.Read.All",
"ChannelMessage.Send",
"ChannelSettings.ReadWrite.All",
"Chat.Read",
"Chat.ReadWrite",
"Directory.AccessAsUser.All",
"Directory.ReadWrite.All",
"Group.ReadWrite.All",
"IdentityProvider.ReadWrite.All",
"Mail.ReadWrite",
"Mail.Send",
"Place.Read.All",
"Policy.Read.All",
"Reports.Read.All",
"ServiceHealth.Read.All",
"ServiceMessage.Read.All",
"ServiceMessageViewpoint.Write",
"Tasks.ReadWrite",
"Team.Create",
"TeamMember.ReadWrite.All",
"TeamsApp.ReadWrite.All",
"TeamsAppInstallation.ReadWriteForUser",
"TeamSettings.ReadWrite.All",
"TeamsTab.ReadWrite.All",
"TermStore.ReadWrite.All",
"User.Invite.All",
"User.ReadWrite.All",
"profile",
"openid",
"email"
]
}
Additional Info
Suspect I'm doing something wrong in loading the json. Using this example from the docs:
m365 aad app add --manifest @testmanifest.json
Results in this error:
ParserError:
Line |
1 | m365 aad app add --manifest @testmanifest.json
| ~~~~~~~~~~~~~
| The splatting operator '@' cannot be used to reference variables in an expression. '@testmanifest' can
| be used only as an argument to a command. To reference variables in an expression use '$testmanifest'.
Description
Unable to create an AD App from a manifest file using the
m365 aad app addcommand. I'm sure I'm doing something wrong, Looking for guidance on how to move forward.Steps to reproduce
Expected results
App should be created in the Azure Tenant with the specified name
Actual results
Error running script:
Error: Error while parsing the specified manifest: SyntaxError: Unexpected token a in JSON at position 3
Diagnostics
Error: Error while parsing the specified manifest: SyntaxError: Unexpected token a in JSON at position 3
CLI for Microsoft 365 version
v5.1.0
nodejs version
v16.14.2
Operating system (environment)
Windows
Shell
PowerShell
cli doctor
{
"os": {
"platform": "win32",
"version": "Windows 10 Enterprise",
"release": "10.0.19042"
},
"cliVersion": "5.1.0",
"nodeVersion": "v16.14.2",
"cliAadAppId": "31359c7f-bd7e-475c-86db-fdb8c937548e",
"cliAadAppTenant": "common",
"authMode": "DeviceCode",
"cliEnvironment": "",
"cliConfig": {},
"roles": [],
"scopes": [
"AllSites.FullControl",
"AppCatalog.ReadWrite.All",
"AuditLog.Read.All",
"ChannelMember.ReadWrite.All",
"ChannelMessage.Read.All",
"ChannelMessage.Send",
"ChannelSettings.ReadWrite.All",
"Chat.Read",
"Chat.ReadWrite",
"Directory.AccessAsUser.All",
"Directory.ReadWrite.All",
"Group.ReadWrite.All",
"IdentityProvider.ReadWrite.All",
"Mail.ReadWrite",
"Mail.Send",
"Place.Read.All",
"Policy.Read.All",
"Reports.Read.All",
"ServiceHealth.Read.All",
"ServiceMessage.Read.All",
"ServiceMessageViewpoint.Write",
"Tasks.ReadWrite",
"Team.Create",
"TeamMember.ReadWrite.All",
"TeamsApp.ReadWrite.All",
"TeamsAppInstallation.ReadWriteForUser",
"TeamSettings.ReadWrite.All",
"TeamsTab.ReadWrite.All",
"TermStore.ReadWrite.All",
"User.Invite.All",
"User.ReadWrite.All",
"profile",
"openid",
"email"
]
}
Additional Info
Suspect I'm doing something wrong in loading the json. Using this example from the docs:
m365 aad app add --manifest @testmanifest.jsonResults in this error:
ParserError:
Line |
1 | m365 aad app add --manifest @testmanifest.json
| ~~~~~~~~~~~~~
| The splatting operator '@' cannot be used to reference variables in an expression. '@testmanifest' can
| be used only as an argument to a command. To reference variables in an expression use '$testmanifest'.