MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.12k stars 21.19k forks source link

Static Web Apps's new API template inconsistent with the Static Web Apps "Add an API" tutorial #114524

Open DLohmann opened 10 months ago

DLohmann commented 10 months ago

Following the steps in the tutorial, the Azure Static Web Apps "Azure Static Web Apps: Create HTTP Function..." command in VsCode does not create the template specified in the tutorial.

The tutorial says "An Azure Functions project is generated with an HTTP triggered function. Your app now has a project structure similar to the following example."

It describes the file api/message/index.js containing the function code.

However, the "Azure Static Web Apps: Create HTTP Function..." VsCode Command Palette command actually creates the function body in api/src/functions/message.js and the function body is different.

Maybe the tutorial should be updated to reflect the changed command.

I think there are 2 potential fixes to this:

Maybe the tutorial could also specify if the npm install -g @azure/static-web-apps-cli and swa start src --api-location api commands should be run in the dev docker container at .devcontainer/Dockerfile or in the host operating system.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ManoharLakkoju-MSFT commented 10 months ago

@DLohmann Thanks for your feedback! We will investigate and update as appropriate.

BryanTrach-MSFT commented 10 months ago

@DLohmann We tried to follow the doc as well and ran into the similar issues. We have assigned your feedback to the doc author to have them review and take action as needed.

andbel commented 9 months ago

While updating the article, please consider adding information on how to use it with a project integrated with Azure Devops Repo/Pipeline (in addition to Github)