Step 1.
In VS Code publish .NET core application running below command in Terminal
dotnet publish -o publish
Step 2. Create a VM(Windows Server 2019 DC Gen1) in azure portal with Static IP Address
Step 3. RDP to VM
Step 4. In server manager-> Local Server-> IE Enhanced Security Configuration= False
Step 5. In server manager-> Dashboard -> Add Roles and Features->Next(3 times)-> Add "Web Server(IIS)"-> Next->Next-> Add Custom Logging and Logging Tools-> Next and Install->Close
Step 6. In IE, type localhost to ensure the web server is installed
Step 7. Download google chrome and .NET core 3.1(ASP.NET Core Runtime 3.1.14->Hosting Bundle)
Step 8. Create a new folder C:\catalog and copy all the contents of publish folder
Step 9. IIS -> Sites->Add Site-> Name= Catalog, Physical Path= C:\catalog, Port=8080
Step 10. Browse from IIS and ensure the site is working
Step 11. To access the site from external system, in the VM open "Windows Defender Firewall" and turn it off both for private and public network. But still the site is not accessible from outside which is the expected behavior and we need to make some changes in the networking
Step 12. Create a Ubuntu VM "weather-vm" in the same vnet with static ip and enable auto shutdown (within management) and user id and password option
Step 13. Download Putty to connect that VM
Step 14. Connect the Unix VM with the Public IP and user id/password
Step 15. run below command
sudo apt install git
sudo apt update
sudo apt install nodejs (click Y)
git clone http://github.com/memilavi/WeatherAPI.git
cd WeatherAPI
ls
sudo apt install npm (click Y)
npm start
Step 16. copy the private IP address of ubuntu VM
Step 17. In windows VM browse the catallog app ->click on weather and type the private IP address: 8080 ->click on "Get Weather"
This proves that 2 VM in same VNET can communicate each other by private IP address but still not accessible from external network
No comments:
Post a Comment