Home > .NET Core, Angular 2, Azure > Publish .NET Core 1.0 site to Azure

Publish .NET Core 1.0 site to Azure

2017/05/24


I’m working to my first Angular2 site , and now that something is working i tried to publish on Azure.
First lesson learned: if you use ASP.NET Identity copy only the table structures(of AspNetRoles table, AspNetUsers and so on) to Azure SQL , but not the data: use a DbSeeder code in Startup .cs to create the initial set of Users, Roles, etc. otherwise you never get successfully the token.
The deployment is simple, as the normal (not Core) ASP.NET sites: right clic on the project then Deploy.
It is recommended to download from Azure the WebApp publish profile

when publish from Visual Studio (in my case, Vs2015)

In order to simplify the process.
Now the site started, but i got an error:

connecting to http://yourazuresite.scm.azurewebsites.net/DebugConsole i noticed that there are not visible .json files… note that opening the web.config it says:
“Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
Oh well, but the Vs2015 publisher does not copy appsettings.json.. and the Core packages? where are? i should try with Vs2017…
So I created with the scm file manager an empty appsettings.json file and an empty package.json file, copied from my pc the text for both files, changed the connection string in appsettings.json.
Then i launched “npm install” in the scm console, that reloads the missing Core packages.
Finally, the site is working.

Advertisements
Categories: .NET Core, Angular 2, Azure
%d bloggers like this: