Answered by:
Deploy application in azure free hosting

Question
-
User-1355965324 posted
I am trying host my application in azure free account . I created the sql database and then I published my application but after running it comes the following error . Please any help
HTTP Error 502.5 - Process Failure
Common causes of this issue: The application process failed to start The application process started but then stopped The application process started but failed to listen on the configured port Troubleshooting steps: Check the system event log for error messages Enable logging the application process' stdout messages Attach a debugger to the application process and inspectMonday, June 22, 2020 3:47 PM
Answers
-
User-1355965324 posted
After commenting out the calling of the function SeedData from program.cs , it is working fine
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Vehicle.Data; using Vehicle.Models; namespace Vehicle { public class Program { public static void Main(string[] args) { // var host = CreateHostBuilder(args).Build(); // using (var scope = host.Services.CreateScope()) // { // var services = scope.ServiceProvider; // var context = services.GetRequiredService<MvcProj3_1Context>(); // SeedData(context); // } // host.Run(); CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); //public static void SeedData(VehicleDBContext context) //{ // if (!context.VehicleType.Any()) // { // var status = new List<VehicleStatus> // { // new VehicleStatus // { // //Id = 1,//if your id is Identity(1,1),no need to specify the id // Status = "Active" // }, // new VehicleStatus // { // Status = "Sold" // }, // new VehicleStatus // { // Status = "Scrapped" // } // }; // context.AddRange(status); // context.SaveChanges(); // } // if (!context.VehicleType.Any()) // { // var type = new List<VehicleType> // { // new VehicleType // { // Category = "Car" // }, // new VehicleType // { // Category = "Van" // }, // new VehicleType // { // Category = "SUV" // }, // new VehicleType // { // Category = "Truck" // }, // new VehicleType // { // Category = "Other" // } // }; // context.AddRange(type); // context.SaveChanges(); // } //} } }
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, June 23, 2020 11:07 AM
All replies
-
User-474980206 posted
so what's the error in error log?
Monday, June 22, 2020 4:05 PM -
User-1355965324 posted
How can I see the error log. Where is the error log is storedMonday, June 22, 2020 4:11 PM -
User-1355965324 posted
when i check the event log i can see the warning
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {2593F8B9-4EAF-457C-B68A-50F6B8EA6B54} and APPID {15C20B67-12E7-4BB6-92BB-7AFF07997402} to the user DESKTOP-MyComp\User SID (S-1-5-21-3243974937-2611643615-2036185151-1001) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.
Another warning
The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {C2F03A33-21F5-47FA-B4BB-156362A2F239} and APPID {316CDED5-E4AE-4B15-9113-7055D84DCC97} to the user mycomp\User SID (S-1-5-21-3243974937-2611643615-2036185151-1001) from address LocalHost (Using LRPC) running in the application container Microsoft.Windows.ShellExperienceHost_10.0.18362.449_neutral_neutral_cw5n1h2txyewy SID (S-1-15-2-155514346-2573954481-755741238-1654018636-1233331829-3075935687-2861478708). This security permission can be modified using the Component Services administrative tool.
Monday, June 22, 2020 4:45 PM -
User-1355965324 posted
I did the following steps to publish in Azure
- select project->publish->appservice->create new. then select create profile. Then I give Appservice name
- create sqldatabase - I given the database server name , Administrator user name and admin password , then click ok
- finally I clicked create button to create Azure sqlDatabase, SQL server, App Service, then it has created Appservice
- after creating the Appservice,I given the database defaultconnection ticked to use this connection string at run time, then i clicked save button.
- After that I clicked Publish button after a while it shows the following error in chrome , Please any idea the reason for this. I dont know how to find the problem and fix
HTTP Error 500.30 - ANCM In-Process Start Failure Common solutions to this issue: The application failed to start The application started but then stopped The application started but threw an exception during startup Troubleshooting steps: Check the system event log for error messages Enable logging the application process' stdout messages Attach a debugger to the application process and inspect
Monday, June 22, 2020 11:24 PM -
User1686398519 posted
Hi polachan,
You need to modify stdoutLogEnabled="false" to stdoutLogEnabled="true". The cause of the process startup failure can be determined from the application event log and the ASP.NET Core module stdout log.
Please refer to this link.
Best Regards,
YihuiSun
Tuesday, June 23, 2020 9:51 AM -
User-1355965324 posted
In which file I can make that changes . I cannot see we.config. Before starting the publish , where do I need to do that changes . Please can you advise me. Web.config is created only after publishing the file. So please can you advise me which file I can make that changes to see the log file
Tuesday, June 23, 2020 9:59 AM -
User-1355965324 posted
After commenting out the calling of the function SeedData from program.cs , it is working fine
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Vehicle.Data; using Vehicle.Models; namespace Vehicle { public class Program { public static void Main(string[] args) { // var host = CreateHostBuilder(args).Build(); // using (var scope = host.Services.CreateScope()) // { // var services = scope.ServiceProvider; // var context = services.GetRequiredService<MvcProj3_1Context>(); // SeedData(context); // } // host.Run(); CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); //public static void SeedData(VehicleDBContext context) //{ // if (!context.VehicleType.Any()) // { // var status = new List<VehicleStatus> // { // new VehicleStatus // { // //Id = 1,//if your id is Identity(1,1),no need to specify the id // Status = "Active" // }, // new VehicleStatus // { // Status = "Sold" // }, // new VehicleStatus // { // Status = "Scrapped" // } // }; // context.AddRange(status); // context.SaveChanges(); // } // if (!context.VehicleType.Any()) // { // var type = new List<VehicleType> // { // new VehicleType // { // Category = "Car" // }, // new VehicleType // { // Category = "Van" // }, // new VehicleType // { // Category = "SUV" // }, // new VehicleType // { // Category = "Truck" // }, // new VehicleType // { // Category = "Other" // } // }; // context.AddRange(type); // context.SaveChanges(); // } //} } }
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, June 23, 2020 11:07 AM