简体   繁体   中英

Why Azure App Service doesn;t use launchSettings.json config?

I need some help.

I deployed Asp Net Core app on Azure App Service(Windows). It's not use my standart configurations in launchSettings.json在此处输入图片说明

But uses random port per starting. For example :

[INF] Now listening on: "http://127.0.0.1:4340"

[INF] Now listening on: "http://127.0.0.1:8105"

[INF] Now listening on: "http://127.0.0.1:13605"

When I running it in my own computer all routes and ports work correct. Why this situation appear with Azure App Service deploy ?

Because launchSettings.json is exclusively for Visual Studio.

From the documentation :

The environment for local machine development can be set in the Properties\\launchSettings.json file of the project. Environment values set in launchSettings.json override values set in the system environment.

The launchSettings.json file:

  • Is only used on the local development machine.
  • Is not deployed.
  • contains profile settings.

Moreover, even if you switched from Visual Studio to Visual Studio Code, you would have to use the file .vscode/launch.json .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM