Hi team,
I'm using the Office 365 cli commands in azure devops release pipeline to deploy the sharepoint packages. We have total 10 release pipelines and it is asking for device login every time for all the pipelines.
Please find the commands below which i'm using to deploy the package and let me know if i have to change any of these commands.
o365 spo login https://$(tenant).sharepoint.com/$(catalogsite) --authType password --userName $(username) --password $(password)
o365 spo app add --filePath "package.sppkg" --overwrite
o365 spo app deploy --name package.sppkg --appCatalogUrl https://$(tenant).sharepoint.com/$(catalogsite)
o365 spo app upgrade --id <
Looks like you are using the older version of Office 365 CLI, I would highly recommend upgrading to v2 which has simplified and improved the login process.
I think also you need to login using device login to give consent, if it is the first time in a tenant see here https://pnp.github.io/office365-cli/user-guide/connecting-office-365/
Hi Garry,
I'm using those commands in release pipeline in Azure DevOps. Before running those command i'm installing the o365 cli using the NPM task with the below mentioned custom command. Please let me know how to mention the version in this task.
"install -g @pnp/office365-cli"
I think also you need to login using device login to give consent, if it is the first time in a tenant see here https://pnp.github.io/office365-cli/user-guide/connecting-office-365/
This is not the first time and it is asking for device login every time. It was working fine till two weeks back suddenly it is started.
Can you pls try - npm install -g @pnp/office365-cli@latest
Can you pls try - npm install -g @pnp/office365-cli@latest
Thank you for instant reply, will try and let you know
Can you pls try - npm install -g @pnp/office365-cli@latest
Thank you for instant reply, will try and let you know
I have tried using the above command but still it is asking for device login.
Can you pls try - npm install -g @pnp/office365-cli@latest
Thank you for instant reply, will try and let you know
I have tried using the above command but still it is asking for device login.
Hey Kiran also I hope you have updated the login command like below as per new login
(From your above command spo should be removed just for login)
login --authType password --userName [email protected] --password pass@word1
And still no luck?
Can you pls try - npm install -g @pnp/office365-cli@latest
Thank you for instant reply, will try and let you know
I have tried using the above command but still it is asking for device login.
Hey Kiran also I hope you have updated the login command like below as per new login
(From your above command spo should be removed just for login)login --authType password --userName [email protected] --password pass@word1
And still no luck?
I'm using the below command for login.
o365 spo login https://$(tenant).sharepoint.com/$(catalogsite) --authType password --userName $(username) --password $(password)
Hey Kiran,
So with the new version like Garry mentioned the login command has changed. you don't need to specify spo in the above command.
https://pnp.github.io/office365-cli/user-guide/connecting-office-365/
Hey @kiranjunnuthula how are you getting on with this?
We have posted a sample since you created this issue using v2 of the CLI which is similar to what you are trying to achieve albeit for Teams apps, hope this helps.
https://pnp.github.io/office365-cli/examples/teams/deploy-teams-app/
Closing due to lack of response
Closing due to lack of response
Sorry for the late reply, it is fine with latest Pnp installation and without SPO in the login command. Thank you very much for the reply..
Thanks for confirming! 馃憤
Most helpful comment
Sorry for the late reply, it is fine with latest Pnp installation and without SPO in the login command. Thank you very much for the reply..