Invoke-D365LcsEnvironmentStop "Unauthorized in starting a new deployment in LCS" #665
Replies: 11 comments 5 replies
-
Could you share the value of the |
Beta Was this translation helpful? Give feedback.
-
That looks like the default url, so that should be fine. |
Beta Was this translation helpful? Give feedback.
-
Also let us know the version of the d365fo.tools module and the PowerShell version. |
Beta Was this translation helpful? Give feedback.
-
Just tried the cmdlet with the newest version of d365fo.tools. Good news, it still works, so the issue is most likely caused by your setup. One more thought, did the user login at least once into the LCS project? |
Beta Was this translation helpful? Give feedback.
-
So the "Unauthorized in starting a new deployment in LCS" is coming from the LCP API, which would indicate that you now have access to the API itself. Could you try run some of the other commands for the API? https://github.com/d365collaborative/d365fo.tools/blob/master/docs/Get-D365LcsEnvironmentMetadata.md If they are successful, then we can narrow things down a bit. Let me know how it goes. 🤞 |
Beta Was this translation helpful? Give feedback.
-
Hello, we are experiencing the same issue while trying to deploy a package with Invoke-D365LcsDeployment. Also, Get-LcsEnvironmentMetadata does not work. Other cmdlets, such as Get-D365LcsAssetFile are working fine. Any idea why? Admin consent has been granted to the application. Note: this project is in the European portal. Maybe this can be the issue? Anyone that can reproduce or has any experience with that? |
Beta Was this translation helpful? Give feedback.
-
You would need to share what API uri/url's that you are trying to work against. And yes - if the project is in the EU geo, almost all LCS api's needs to be using the eu.lcs.dynamics.com notion. |
Beta Was this translation helpful? Give feedback.
-
Yes, we are using the following LCS API URI: https://lcsapi.eu.lcs.dynamics.com Snippet example:
|
Beta Was this translation helpful? Give feedback.
-
And you're sure that the username and password isn't MFA enforced? Is it possible for you to proved that the above code works, against the US based LCS? I know it will be another customer and other details, but it will make it easier to compare settings and other stuff. |
Beta Was this translation helpful? Give feedback.
-
It was as simple as assigning Project Owner to the service user in the project settings. Many thanks for the help anyway :) |
Beta Was this translation helpful? Give feedback.
-
@psdgal Thanks for the feedback. The Environment Manager role for the service user should also work. @harishmohanbabu I reread the issue and had a new idea: If you try to deploy to a T1 environment, check its topology. Not all topologies allow deployment (I'm sure this is the case for the Build + Test topology, but others might have that restriction as well). |
Beta Was this translation helpful? Give feedback.
-
Hi,
Trying to create a PS script for stopping a Tier1 VM. It is a simple PS script which has parameters for values such as client Id, user name, password etc.
Below is the snippet where I obtain the access token first and then the command for stopping the environment.
And finally receive the below error -
The user is configured as environment owner in the LCS project and manually is able to start/stop the environment from the LCS. Any suggestions on how to resolve this issue, please. Thanks,
Beta Was this translation helpful? Give feedback.
All reactions