Debug your code, use source control with git and github and, deploy you app to azure.
3 – Debug, deploy and source control
3.1 – Debug C# code
Once you installed a C# debugger like the one that comes with C# extension See more here and have .NET Core Sdk installed.
- You can start by running your app using .NET Core CLI command
dotnet runordotnet watch runfrom terminal (this needs to target C# project) - Press F5 to open process selector and select your app .exe process.
- From now you’re in debugging mode, you can use all common shortcuts you can use with Visual Studio as : F9, F10, F11, Shift + F11, F5, etc. See more here
3.2 – Source control with git and github
You may have git installed in your machine See more here and have a github account and repositories created !
Clone a github repository :
- You can select Ctrl + Shift + P to open command palette and type “clone” to find a git clone command, press Enter !
- Past your repository’s link (example : https://github.com/user/repo.git)
- Press Enter to confirm or Escape to cancel
- Your code is now locally downloaded inside a git folder. See how to init a git repository
Stage, commit and push :
- Click on the source control icon at the left or select Ctrl + Shift + G to see changes of tracked files.
- Stage by clicking “(+) icon” or ignore changes before commit (Stage allow you to select changes to commit)
- Add message and select Ctrl + Enter
- Click more action “(…) icon” and select push, this may require to login if not already done
3.3 – Deploy to Azure App Service
If you already have an Azure Portal account with one year free services option or payed one, you could connect and use Azure App Service from VS Code !
- Create production builds of your apps (.NET Core, Angular, etc.)
- Install Azure Account and Azure App Service extensions (See more here). This will add an icon to VS Code.
- Click this icon and try to connect to you Azure Portal account
- Find your subscription and expand it to select your web app (App Service)
- Inside you web app App Service, the “Files” folder will be populated with your production builds and to do that you need
- click on “Deploy to Web App …” (button at the top that have like an upload icon)
- “Browse” and select your publish folder (ex : bin/release/<your_app_framework/publish)
- Select Web App to select you web app App Service and confirm by clicking Deploy (skip fow now if any other alerts)
- Your deployed web app is now accessible using App Service link !
