Create and Publish NETCore web-API running on Azure container Instance

Refer to this article I'm testing for VM scale set by hosting the web-API on IIS inside Virtual manchin: Link: Testing Azure VMs Autoscale with the Load balancer

In this article, I will use the same source code as the previous lab to create the container instances rather than VMs

There is 3 part 

First: Create Net core web API from Visual Studio 2019

Second: Publish project to Azure container registry 

Third: Create Azure container instances and Run


   First part

1. Create Project: Select ASP NET Core Web API



2. Project Name and Local file




3.  Addition Information

- Target Framework Choose Netcore 5
- Enable Docker >> Windows




4.  New Project has been created



5. on the First run. The system will pull data for provisioning contianer.




6. Web browser open automatically for swagger UI





*** Before go to publish step. I add a couple classes (Inventory Update, Database connection to Azure SQL)
This coding will simulate the ERP sales order Logic and consume CPU usage for performance testing purposes

*** This logic will use the same as future testing with Azure computing service


SQL Utility : .


Sales Order commit under HTTP POST method.



Second Publish project to Azure container registry 
1.  Menu Build >> Publish



2.  Select Azure container Registry
 


3. Select Resource group, Location to deploy on Azure.


4. Publish Success



Third: Create Azure container instances and Run

1. On target, Azure resource group already has Container registry created



2. Select Repository and Run



3. Defined Container Instance config value
4. Testing API by sending HTTP GET method from Container instance public IP






Right now The container has been ready to test

Next  Article I will compare the performance of different Azure computing services base on my scenario