如何通过端点将Azure Frontend静态Web应用程序连接到Azure后端应用程序服务?

发布于 2025-02-08 11:22:16 字数 242 浏览 2 评论 0 原文

对于一个学习项目,我们构建了前端和后端应用程序。前端“应用程序”只是一堆链接的HTML/CSS/JavaScript文件。后端应用程序是带有某些端点的Spring Boot / Maven / Java项目。

当我在本地运行后端应用程序时,我可以使用Postman成功地发送邀请。现在,我们已经通过Azure托管了后端应用程序,我不知道如何发送邀请,我不知道要使用哪个URL。

完成此工作后,我想使用这些URL连接前端应用程序和后端应用程序。

For a learning project we've built a frontend and backend application. The frontend "application" is just a bunch of linked html/css/javascript files. The backend application is a spring boot / maven / java project with some endpoints.

When I run the backend application locally I am able to send a GET-request successfully using Postman. Now we've hosted the backend application via Azure and I have no idea how I can send a GET-request, I don't know which url to use.

After I get this to work I'd like to connect front- and backend application using these url's.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

粉红×色少女 2025-02-15 11:22:16

由于您可以成功地在本地环境中运行后端应用程序,因此您必须按照以下步骤进行配置和部署Spring Web应用程序到Azure App Service:

  • 在终端窗口中,运行以下命令以使用该命令将Web应用程序配置为

./ mvnw com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:14.0:config

  • 然后,在命令提示符下,运行此maven命令并设置默认配置通过键入输入确认(y/n) => 'y',配置将完成。

  • 完成上述步骤后,运行
    MVN Azure-Webapp:部署将Web应用发布到Azure。

  • 您的WebApp URL 将显示在输出中。

我不知道要使用哪个URL?

您可以使用Maven控制台输出中的URL并访问Web应用程序。

另请参阅此知道如何部署前端并后端到同一应用服务计划。

As you can run the backend application in your local environment successfully, you have to follow the below steps to configure and deploy the spring boot web app to azure app service:

  • In a terminal window, run the following command to configure your web app with the Azure Maven Plugin

./mvnw com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config

  • Then, at the Command Prompt, run this maven command and set the default configurations by typing ENTER and Confirm (Y/N) => 'y' and the configuration will gets completed.

  • Once you've done with the above steps, run
    mvn azure-webapp:deploy to publish the web app to Azure.

  • Your webapp URL will be displayed in the output.

I don't know which url to use?

You can use that URL from maven console output and access the web-app.

Also Refer this SO thread to know how to deploy frontend and backend to the same app service plan.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文