microsoft / vscode-azurestaticwebapps

Azure Static Web Apps extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps
MIT License
86 stars 33 forks source link

Explore Azure WebSiteManagement REST client library 🚀 #713

Open alexweininger opened 2 years ago

alexweininger commented 2 years ago

Azure SDK team has released a beta of what they call a "REST level client" or RLC.

https://www.npmjs.com/package/@azure-rest/arm-appservice

Read this issue to learn about what problems this new type of SDK solves for us.

In summary, old package bundle size: 940.4 kB new package bundle size: 38.4 kB 🚀

They'd like to hear any feedback we have here 👉 https://github.com/Azure/azure-sdk-for-js/issues/22017

Note: these gains aren't limited to SWA, but all the extensions that use the app service SDK. We can benefit from the RLC versions of any SDKs we use throughout our extensions.

alexweininger commented 2 years ago

Some notes from my exploration...

Helpful docs:

Important related packages:

core-http-compat - compat layer from @azure/core-http to @azure/core-client & @azure/core-rest-pipeline https://www.npmjs.com/package/@azure/core-http-compat https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-http-compat

It seems like we need to migrate from @azure/ms-rest-js -> @azure/core-client and @azure/core-http-pipeline

I converted a few client calls in SWA to the RLC, and it worked well. I had to obtain and pass in the Authorization header manually to get authentication to work.