microsoft / vscode-deploy-azure

VS code extension: Deploy To Azure, which helps set up CI/CD for deployment to Azure Resources.
MIT License
18 stars 19 forks source link

Use event to read publish profile from stream instead of sync way #110

Closed bishal-pdMSFT closed 4 years ago

bishal-pdMSFT commented 4 years ago

This fixes the bug where reading publish profile hangs waiting for the stream to become readable.

The root cause of the hang was the fact that ms-rest library mandatorily JSON-deserializes the ARM response. In case of publish profile, it was failing to de-serialize as publish profiles contain double quotes. The fix to handle this is to escape the quotes and then JSON stringify.

Added a filter which is a way provided by ms-rest to add filters in the request pipeline. First tried to add it to AppServiceClient itself but somehow azure-arm-website library was not handling the filter or the output properly. Since, there is less level of control over the website client as it is part of azure-arm-website package, I decided to use a lower level library - ArmRestClient. This client has been used for AKS related calls, so it seems fine to use for websites as well.

bishal-pdMSFT commented 4 years ago

@kanika1894 @vineetmimrot @anuragc617 please review. I have updated the description as well.

bishal-pdMSFT commented 4 years ago

Abandoning as Anurag had a better fix.