alexanderzeitler.com - Deploying a ASP.NET MVC 6 API as Azure API App in Azure App Services









Search Preview

Deploying a ASP.NET MVC 6 API as Azure API App in Azure App Services | Alexander Zeitler

alexanderzeitler.com

.com > alexanderzeitler.com

SEO audit: Content analysis

Language Error! No language localisation is found.
Title Deploying a ASP.NET MVC 6 API as Azure API App in Azure App Services | Alexander Zeitler
Text / HTML ratio 49 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud API Azure = App public create add ASPNET MVC inside Studio Visual Web Swagger Swashbuckle SDK Apps set Twitter tooling
Keywords consistency
Keyword Content Title Description Headings
API 31
Azure 20
= 18
App 13
public 12
create 11
Headings
H1 H2 H3 H4 H5 H6
1 0 5 0 0 0
Images We found 22 images on this web page.

SEO Keywords (Single)

Keyword Occurrence Density
API 31 1.55 %
Azure 20 1.00 %
= 18 0.90 %
App 13 0.65 %
public 12 0.60 %
create 11 0.55 %
add 10 0.50 %
ASPNET 8 0.40 %
MVC 8 0.40 %
inside 7 0.35 %
Studio 7 0.35 %
Visual 7 0.35 %
Web 7 0.35 %
Swagger 7 0.35 %
Swashbuckle 7 0.35 %
SDK 6 0.30 %
Apps 6 0.30 %
set 6 0.30 %
Twitter 6 0.30 %
tooling 6 0.30 %

SEO Keywords (Two Word)

Keyword Occurrence Density
API App 11 0.55 %
Azure API 9 0.45 %
create a 9 0.45 %
in the 8 0.40 %
to the 7 0.35 %
Visual Studio 7 0.35 %
the API 7 0.35 %
MVC 6 6 0.30 %
ASPNET MVC 6 0.30 %
you should 6 0.30 %
the Azure 6 0.30 %
a new 5 0.25 %
inside the 5 0.25 %
Azure SDK 5 0.25 %
2015 RC 5 0.25 %
Studio 2015 5 0.25 %
get set 4 0.20 %
new Azure 4 0.20 %
add the 4 0.20 %
Web API 4 0.20 %

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam
Azure API App 6 0.30 % No
ASPNET MVC 6 6 0.30 % No
the API App 5 0.25 % No
Visual Studio 2015 5 0.25 % No
Studio 2015 RC 5 0.25 % No
we have to 4 0.20 % No
create a new 4 0.20 % No
Speaker Id = 3 0.15 % No
Azure SDK 26 3 0.15 % No
new Speaker Id 3 0.15 % No
get set public 3 0.15 % No
in Visual Studio 3 0.15 % No
in the video 3 0.15 % No
Web API 2 3 0.15 % No
shown in the 3 0.15 % No
new Azure API 3 0.15 % No
a new Azure 3 0.15 % No
Azure API Apps 3 0.15 % No
set public string 3 0.15 % No
the Azure Portal 3 0.15 % No

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam
Visual Studio 2015 RC 5 0.25 % No
create a new Azure 3 0.15 % No
shown in the video 3 0.15 % No
new Azure API App 3 0.15 % No
new Speaker Id = 3 0.15 % No
a new Azure API 3 0.15 % No
get set public string 3 0.15 % No
= Scott LastName = 2 0.10 % No
MVC to the request 2 0.10 % No
to the request pipeline 2 0.10 % No
in Visual Studio 2015 2 0.10 % No
Add MVC to the 2 0.10 % No
get the JSON representation 2 0.10 % No
FirstName = Scott LastName 2 0.10 % No
should get the JSON 2 0.10 % No
Web API 2 controllers 2 0.10 % No
as shown in the 2 0.10 % No
version 100 title HelloApiApps 2 0.10 % No
HelloApiApps summary author endpoints 2 0.10 % No
and Azure SDK 26 2 0.10 % No

Internal links in - alexanderzeitler.com

Fixing Chrome 58+ [missing_subjectAltName] with openssl when using self signed certificates
Fixing Chrome 58+ [missing_subjectAltName] with openssl when using self signed certificates | Alexander Zeitler
Accessing an HTTP API running on your MacBook in a Docker container from your iPhone/iPad using dnsmasq
Accessing an HTTP API running on your MacBook in a Docker container from your iPhone/iPad using dnsmasq | Alexander Zeitler
Deploying Ubuntu Mate Desktop as a developer environment in a Azure VM
Deploying Ubuntu Mate Desktop as a developer environment in a Azure VM | Alexander Zeitler
Deploying Ubuntu Mate Desktop as a developer environment in AWS EC2
Deploying Ubuntu Mate Desktop as a developer environment in AWS EC2 | Alexander Zeitler
Debugging mocha tests in a Docker container using Visual Studio Code
Debugging mocha tests in a Docker container using Visual Studio Code | Alexander Zeitler
Debugging mocha tests with Visual Studio Code when Node.js is installed using nvm
Debugging mocha tests with Visual Studio Code when Node.js is installed using nvm | Alexander Zeitler
Debugging a ES6 Node.js application in a Docker container using Visual Studio Code
Debugging a ES6 Node.js application in a Docker container using Visual Studio Code | Alexander Zeitler
Some thoughts on Open Source Software
Some thoughts on Open Source Software | Alexander Zeitler
Resizing a VMware Workstation VM partition using GParted - get the swap partition out of my way!
Resizing a VMware Workstation VM partition using GParted - get the swap partition out of my way! | Alexander Zeitler
Workflows: using Docker Machine and Docker Compose together in development
Workflows: using Docker Machine and Docker Compose together in development | Alexander Zeitler
Chrome crashes on Ubuntu in VMware Workstation
Chrome crashes on Ubuntu in VMware Workstation | Alexander Zeitler
Rename Visual Studio project including files, folders and namespaces
Rename Visual Studio project including files, folders and namespaces | Alexander Zeitler
A lap around AWS and docker-machine
A lap around AWS and docker-machine | Alexander Zeitler
Integration-testing ASP.NET 5 / MVC 6 Controllers on DNX Beta 4
Integration-testing ASP.NET 5 / MVC 6 Controllers on DNX Beta 4 | Alexander Zeitler
Deploying a ASP.NET MVC 6 API as Azure API App in Azure App Services
Deploying a ASP.NET MVC 6 API as Azure API App in Azure App Services | Alexander Zeitler
lowerCamelCase JSON with ASP.NET MVC 6
lowerCamelCase JSON with ASP.NET MVC 6 | Alexander Zeitler
Running ASP.NET 5 Beta 4 in Docker with DNX runtime #aspnet5 #docker
Running ASP.NET 5 Beta 4 in Docker with DNX runtime #aspnet5 #docker | Alexander Zeitler
Stop complaining or improve yourself
Stop complaining or improve yourself | Alexander Zeitler
#NodeJS / #ExpressJS: Adding routes dynamically at runtime
#NodeJS / #ExpressJS: Adding routes dynamically at runtime | Alexander Zeitler
mongoose: Referencing schema in properties or arrays
mongoose: Referencing schema in properties or arrays | Alexander Zeitler
MongoDB development environment journal size management using mongoctl
MongoDB development environment journal size management using mongoctl | Alexander Zeitler
Farewell...
Farewell... | Alexander Zeitler
Inspecting AngularJS $scope using Firebug and Chrome Developer Tools
Inspecting AngularJS $scope using Firebug and Chrome Developer Tools | Alexander Zeitler
Useful @Brackets extensions for Web Developers
Useful @Brackets extensions for Web Developers | Alexander Zeitler
.NET User Group Karlsruhe: StreamInsight: Complex Event Processing by Microsoft
.NET User Group Karlsruhe: StreamInsight: Complex Event Processing by Microsoft | Alexander Zeitler
“Commit all must be called when a managed buffer has focus” in Microsoft SQL Server Data Tools
“Commit all must be called when a managed buffer has focus” in Microsoft SQL Server Data Tools | Alexander Zeitler
.NET User Group Karlsruhe: Git
.NET User Group Karlsruhe: Git | Alexander Zeitler
Open Source Windows 8 App: Sprudelsuche
Open Source Windows 8 App: Sprudelsuche | Alexander Zeitler
Open Source– Scheissegal?
Open Source– Scheissegal? | Alexander Zeitler
Lowercase JSON with ASP.NET Web API
Lowercase JSON with ASP.NET Web API | Alexander Zeitler
.NET Usergroup Karlsruhe: Think Big – Entwicklung skalierbarer Anwendungen mit Windows Azure
.NET Usergroup Karlsruhe: Think Big – Entwicklung skalierbarer Anwendungen mit Windows Azure | Alexander Zeitler
ASP.NET Web API and RavenDb
ASP.NET Web API and RavenDb | Alexander Zeitler
ASP.NET Web API Round-Up Slides
ASP.NET Web API Round-Up Slides | Alexander Zeitler
ASP.NET MVC 4 public beta including ASP.NET Web API
ASP.NET MVC 4 public beta including ASP.NET Web API | Alexander Zeitler
Hash Bang Urls in Single Page Applications mit ASP.NET MVC
Hash Bang Urls in Single Page Applications mit ASP.NET MVC | Alexander Zeitler
.NET User Group Karlsruhe: Know your Tools
.NET User Group Karlsruhe: Know your Tools | Alexander Zeitler
Git flow init liefert: flags: FATAL unable to determine getopt version unter Cygwin
Git flow init liefert: flags: FATAL unable to determine getopt version unter Cygwin | Alexander Zeitler
Using JsonValue and JsonArray in WCF Web API
Using JsonValue and JsonArray in WCF Web API | Alexander Zeitler
.NET User Group Karlsruhe: PowerShell 3.. 2.. 1..
.NET User Group Karlsruhe: PowerShell 3.. 2.. 1.. | Alexander Zeitler
What’s new in WCF Web API Preview 5 – introducing the test client
What’s new in WCF Web API Preview 5 – introducing the test client | Alexander Zeitler
Externe Templates in KnockoutJS laden
Externe Templates in KnockoutJS laden | Alexander Zeitler
WCF Web API: Role based access control with basic authentication
WCF Web API: Role based access control with basic authentication | Alexander Zeitler
.NET User Group Karlsruhe: Produce Cleaner Code with Aspect-Oriented Programming (AOP)
.NET User Group Karlsruhe: Produce Cleaner Code with Aspect-Oriented Programming (AOP) | Alexander Zeitler
REST using the WCF Web API – POST it!
REST using the WCF Web API – POST it! | Alexander Zeitler
REST using the WCF Web API – getting more RESTful responses (Part 5)
REST using the WCF Web API – getting more RESTful responses (Part 5) | Alexander Zeitler
TypeLoadException when mocking COM objects - Could not load type … from assembly. The type is marked…
TypeLoadException when mocking COM objects - Could not load type … from assembly. The type is marked… | Alexander Zeitler
REST using the WCF Web API – getting RESTful the BDD way (Part 4)
REST using the WCF Web API – getting RESTful the BDD way (Part 4) | Alexander Zeitler
REST using the WCF Web API – refactoring to IoC style (Part 3)
REST using the WCF Web API – refactoring to IoC style (Part 3) | Alexander Zeitler
REST using the WCF Web API – Basics (Part2)
REST using the WCF Web API – Basics (Part2) | Alexander Zeitler
Microsoft Web API – the REST is done by WCF (Part 1)
Microsoft Web API – the REST is done by WCF (Part 1) | Alexander Zeitler
Microsoft Web API – den REST macht WCF (Teil 1)
Microsoft Web API – den REST macht WCF (Teil 1) | Alexander Zeitler
.NET User Group Karlsruhe: Flexible Softwarearchitekturen mit Inversion of Control (IoC)
.NET User Group Karlsruhe: Flexible Softwarearchitekturen mit Inversion of Control (IoC) | Alexander Zeitler
machine.fakes ReSharper Templates
machine.fakes ReSharper Templates | Alexander Zeitler
CreateCert.cmd aus dem Windows Azure Platform Training Kit funktioniert nicht
CreateCert.cmd aus dem Windows Azure Platform Training Kit funktioniert nicht | Alexander Zeitler
JSON via jQuery direkt an einen ASP.NET MVC 3 Controller senden
JSON via jQuery direkt an einen ASP.NET MVC 3 Controller senden | Alexander Zeitler
POSTing Json data using the HttpClient from WCF Web API
POSTing Json data using the HttpClient from WCF Web API | Alexander Zeitler
Using the new WCF Web APIs HttpClient with ASP.NET Forms Authentication
Using the new WCF Web APIs HttpClient with ASP.NET Forms Authentication | Alexander Zeitler
Keyboard Jedi unter x64
Keyboard Jedi unter x64 | Alexander Zeitler
Using WCF Web APIs / WCF Http with ASP.NET Forms Authentication
Using WCF Web APIs / WCF Http with ASP.NET Forms Authentication | Alexander Zeitler
WCF Web APIs / WCF Http mit ASP.NET Forms Authentication verwenden
WCF Web APIs / WCF Http mit ASP.NET Forms Authentication verwenden | Alexander Zeitler
ILSpy – Open Source .NET Assembly Browser und Decompiler
ILSpy – Open Source .NET Assembly Browser und Decompiler | Alexander Zeitler

Alexanderzeitler.com Spined HTML


Deploying a ASP.NET MVC 6 API asUltramarineAPI App inUltramarineApp Services | Alexander Zeitler Toggle navigation Home Feed Deploying a ASP.NET MVC 6 API asUltramarineAPI App inUltramarineApp Services Written on May 02, 2015 Setting some context... Disclaimer: this post is based on Visual Studio 2015 RC, DNX beta 4 andUltramarineSDK 2.6 and might wilt obsolete (hopefully pretty fast). At Build 2015 "The Lesser Scotts" have been showing how to create aUltramarineAPI App based on ASP.NET Web API 2 using theUltramarineSDK Tools in Visual Studio 2013 which you should definitely watch surpassing reading this post. Well, deploying stable stuff is pretty neat.But my first thought of undertow has been "What well-nigh ASP.NET MVC 6 on DNX beta 4?". So I asked the lesser Scotts at Twitter: Scotts wordplay was pretty promising: My next step of undertow was installingUltramarineSDK 2.6 for Visual Studio 2015 RC and trying to create a newUltramarineAPI App as shown in the video above. But there were no templates... so when to Twitter - this time Brady Gaster was my victim: No promising wordplay but at least some facts :) Ok, lets do some reverse engineering using Visual Studio 2013 andUltramarineSDK 2.6 and find out what happens when you're using the SDK tooling - I'll skip this step here and show you, how to get stuff washed-up in Visual Studio 2015 RC and ASP.NET MVC 6 on DNX beta 4 now. First things first, the ASP.NET MVC 6 API First, create a new ASP.NET Web Application in Visual Studio 2015 RC:Withoutthis, your solution should squint like this: As the default ValuesController.cs in the Controllers folder is pretty useless (and it will rationalization problems as you can read later on), we'll delete it and create a SpeakersController.cs instead. SpeakersController.cs: using System.Collections.Generic; using HelloApiApps.Models; using Microsoft.AspNet.Mvc; namespace HelloApiApps.Controllers { [Route("api/[controller]")] public matriculation SpeakersController { [HttpGet] public IEnumerable<Speaker> GetAll() { return new List<Speaker> { new Speaker { Id = 1, FirstName = "Scott", LastName = "Hanselman", Twitter = "shanselman" }, new Speaker { Id = 2, FirstName = "Scott", LastName = "Hunter", Twitter = "coolcsh" }, new Speaker { Id = 3, FirstName = "Damian", LastName = "Edwards", Twitter = "DamianEdwards" } }; } } } We moreover create a folder Models and create a Speaker.cs in it: Speaker.cs: namespace HelloApiApps.Models { public matriculation Speaker { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Twitter { get; set; } } } At this time, you should be worldly-wise to test your API locally at http://localhost:someport/api/speakers and you should get the JSON representation of our speaker list. Creating the Swagger API definition file According to the Scott's video we now would create the Swagger file, but Swashbuckle shown in the video doesn't work with ASP.NET MVC 6 right now. To the rescue, there's once a work in progress project on GitHub which is porting Swashbuckle to ASP.NET MVC 6: Ahoy! We create a local clone of Ahoy and for the sake of keeping this post simple, we add the Swashbuckle.Swagger project inside our API Solution as existing project: Next, we have to register Swashbuckle / Swagger inside our Startup.cs Startup.cs: using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.AspNet.Routing; using Microsoft.Framework.DependencyInjection; using Swashbuckle.Application; using Swashbuckle.Swagger; namespace HelloApiApps { public matriculation Startup { public Startup(IHostingEnvironment env) { } // This method gets tabbed by a runtime. // Use this method to add services to the container public void ConfigureServices(IServiceCollection services) { services.AddMvc(); // Uncomment the pursuit line to add Web API services which makes it easier to port Web API 2 controllers. // You will moreover need to add the Microsoft.AspNet.Mvc.WebApiCompatShim package to the 'dependencies' section of project.json. // services.AddWebApiConventions(); services.AddSwagger(s => { s.SwaggerGenerator(c => { c.Schemes = new[] { "http", "https" }; c.SingleApiVersion(new Info { Version = "v1", Title = "Swashbuckle Sample API", Description = "A sample API for testing Swashbuckle", TermsOfService = "Some terms ..." }); }); s.SchemaGenerator(opt => opt.DescribeAllEnumsAsStrings = true); }); } // Configure is tabbed without ConfigureServices is called. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { // Configure the HTTP request pipeline. app.UseStaticFiles(); // Add MVC to the request pipeline. app.UseMvc(); // Add the pursuit route for porting Web API 2 controllers. // routes.MapWebApiRoute("DefaultApi", "api/{controller}/{id?}"); // Add MVC to the request pipeline. app.UseMvc(routes => { routes.EnableSwagger("swagger/docs/{apiVersion}"); }); } } } The default Swagger URL for Swashbuckle has been (as shown in the video): http://somehost:someport/swagger/docs/v1. By default, with Ahoy this has reverted to http://somehost:someport/swagger/v1/swagger.json whereas in both cases v1 depends on the Version property stuff set during Swashbuckle registration in Startup.cs inside the ConfigureServices method in the lawmaking shown above. Thus, we have to transpiration the route definition when to the old format asUltramarineAPI Apps expect it in that format. You can see that inside the Configure method of the Startup.cs in the lawmaking shown above. Next, we can unshut up our App in a browser then and scan to http://localhost:someport/swagger/docs/v1 and we should get the JSON representation. AddingUltramarineAPI Apps Metadata Now we need to add the Metadata for theUltramarineAPI Apps manually as we don't have the tooling support right now... First, add a JSON file named apiapp.json in the root of the API App project: Then paste this content into it: { "$schema": "http://json-schema.org/schemas/2014-11-01/apiapp.json#", "id": "HelloApiApps", "namespace": "microsoft.com", "gateway": "2015-01-14", "version": "1.0.0", "title": "HelloApiApps", "summary": "", "author": "", "endpoints": null } Next, add the pursuit folders and files to your wwwroot folder in the API App solution: The content of the apiDefinition.swagger.json is the output from http://localhost:someport/swagger/docs/v1. Copy and paste it into the file. Important Note: Make sure your API Controllers don't contain zipped method names (e.g. "Get" twice), this will rationalization problems at the moment. Thanks to @Mohit for sorting that out! The last file required, is the apiappconfig.azureresource.json and it's content is this: { "$schema": "http://schemas.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "$system": { "type": "Object" } }, "resources": [] } <Update [2015/05/02]>: Instead of providing a static snapshot of your Swagger API definition, you can moreover provide an endpoint where the current swagger definition can be read from. This solves two problems: the route can be the new route template Ahoy introduces and your Swagger definition is unchangingly up to stage when add new API endpoints (Controllers / Methods). Just update the apiapp.json and add an fill the endpoint property (please note that I'm use the new default Ahoy route here): { "$schema": "http://json-schema.org/schemas/2014-11-01/apiapp.json#", "id": "HelloApiApps", "namespace": "microsoft.com", "gateway": "2015-01-14", "version": "1.0.0", "title": "HelloApiApps", "summary": "", "author": "", "endpoints": { "apiDefinition": "/swagger/v1/swagger.json" } } Kudos go to @pkefal for the hint (By the way: if you want to create API Apps using Node.js you should definitely read his article) </end of update [2015/05/02]> Another step, theUltramarineSDK tooling does, is subtracting two NuGet packages and we have to do that also. Update your project.json and add Microsoft.Azure.AppService.ApiApps.Service and System.IdentityModel.Tokens.Jwtto it. { "webroot": "wwwroot", "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.Mvc": "6.0.0-beta4", "Microsoft.AspNet.Server.IIS": "1.0.0-beta4", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta4", "Microsoft.Azure.AppService.ApiApps.Service": "0.9.40", "System.IdentityModel.Tokens.Jwt": "4.0.2.202250711", "Microsoft.AspNet.StaticFiles": "1.0.0-beta4", "Swashbuckle.Swagger": "1.0.0-*" }, "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000" }, "frameworks": { "dnx451": { }, "dnxcore50": { } }, "exclude": [ "wwwroot", "node_modules", "bower_components" ], "publishExclude": [ "node_modules", "bower_components", "**.xproj", "**.user", "**.vspscc" ] } Publishing the API App If there were tooling support, you could create a newUltramarineAPI App using the tooling. Yet: no tooling, thus we have to use the newUltramarinePortal. Login using your credentials and create a newUltramarineAPI App. Disclaimer: Depending on your plan and the settings, this will forfeit you money!Withouta few seconds, you'll get the success notification inside theUltramarinePortal and you should have a new tile on the Portal startpage and clicking on it should get you some details: Now make sure to set the "Access Level" inside the "Settings" / "Application Settings" to "public (anonymous)" and click the "Save" sawed-off afterwards:Whento Visual Studio 2015 RC, we can now publish ourUltramarineAPI App by right clicking the project and selecting "Publish...": The next dialog allows you to select where to publish: Select "MicrosoftUltramarineWeb Apps" and click "Next". Now from "Existing Web Apps", select the API App you just created inside theUltramarinePortal and click "OK": The next dialog sums up the connection details and can be confirmed with "Next": During the next step, you can segregate your DNX version to be used for the API App - the defaults are ok, click "Next": The last step is to hit the "Publish" button: The publishing process should take only a few seconds: When it is finished, it should unshut up your default browser showing you this:Whento theUltramarinePortal you should now be worldly-wise to click on the "API Definition" tile and see the API Operations and be worldly-wise to download the Swagger using the sawed-off whilom the list of Operations. That's it! Please enable JavaScript to view the comments powered by Disqus. Copyright © Alexander Zeitler 2003 - 2016 | Impressum