Comments (5)
I checked what parameters LCS currently sends on start/stop and compared to 2LCS and there is an extra parameter EnvironmentId. I did a quick test and after adding the EnvironmentId parameter, the start/stop action is already performed correctly.
internal async Task<bool> StartStopDeployment(CloudHostedInstance instance, string action)
{
var parameters = $"{action}=&ActivityId={instance.ActivityId}&ProductName={WebUtility.UrlEncode(instance.ProductName)}&TopologyName={instance.TopologyName}&TopologyInstanceId={instance.InstanceId}&AzureSubscriptionId={instance.AzureSubscriptionId}&EnvironmentGroup=0&EnvironmentId={instance.EnvironmentId}";
using (_stringContent = new StringContent(parameters, Encoding.UTF8, "application/x-www-form-urlencoded"))
{
SetRequestVerificationToken($"{LcsUrl}/V2");
var result = await _httpClient.PostAsync($"{LcsUrl}/DeploymentPortal/StartStopDeployment/{LcsProjectId}", _stringContent);
result.EnsureSuccessStatusCode();
var responseBody = result.Content.ReadAsStringAsync().Result;
return responseBody == "true";
}
}
from 2lcs.
We observe the same behavior :-(
from 2lcs.
Thanks for reporting, I can reproduce a similar issue with version 0.43.0. For me, when trying to stop a CHE, I first get a dialog "Please login to LCS again. Your cookie probably expired". After I confirm with OK, the blank login form appears for a few seconds, then vanishes and the "Choose LCS project" form is shown instead.
I also tried logging out and in again, but that did not resolve the issue.
The error occurs here (line 713):
Lines 706 to 717 in cfe5671
What happens is that the call to the LCS API returns a 500 status code (internal server error). /DeploymentPortal/StartStopDeployment
is not part of the official LCS API to start/stop environments. This part of 2LCS was probably written before that API was available. It is also possible that the official API would not work with the 2LCS approach of authentication. My guess would be that Microsoft made changes to the /DeploymentPortal/StartStopDeployment
part of the API.
@TomekMelissa This is a bit out of my wheel house. Do you know if /DeploymentPortal/StartStopDeployment
can still be used and what changes we would have to make?
from 2lcs.
Awesome, thank you @petrjanikac . A new version with the fix is available in https://github.com/microsoft/2LCS/releases/tag/v.0.44.0.
from 2lcs.
Awesome indeed, thank you @petrjanikac for a fast fix. Verified that it works :)
from 2lcs.
Related Issues (20)
- Refresh all function HOT 1
- Crash when LCS is not accessible HOT 2
- .Net core
- Version 27 & 28 are unstable HOT 8
- change LCS login HOT 2
- Refresh instances for project - Not working on Self service environments
- RDP in full screen HOT 4
- Data region HOT 1
- New feature. Secrets expired
- LCS will start returning HTTP 429 Too Many Requests HOT 3
- Adding access to Database on Tier2
- Region support HOT 9
- This repo is missing important files HOT 1
- .NET core and Process.start HOT 3
- :bug: Date/time fields in grids are sorted alphabetically HOT 3
- :children_crossing: Improve visibility of application icon in Windows dark mode.
- 🚸 Auto refresh cloud-hosted instance entry after start/stop until instance is Deployed/Stopped
- Can't get a list of packages for MS-hosted environments HOT 4
- RDP instant mode doesn't work HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 2lcs.