At Experts Live Europe 2019 I presented a session titled “Master Azure with VS Code”. This was a fun session with an engaging audience that took to twitter after the session. There was some chatter asking this session was recorded. It was not. I did note that I planned to write a blog post on this topic.
Here is that blog post and it is the first one of 2020 for me! In this post, we are going to dive into how VS code is helpful when working with Azure and many extensions I find useful when working with Azure. This post is not set to be an end-all to using VS Code with Azure but from my experience. Use this post as a starting point or a reference for expanding your use of VS Code with Azure. Also, check out the many other community experts and Microsoft MVPs for their additional knowledge plus tips and tricks on this topic.
VS Code Overview
First off if you are not using VS Code stop reading this right now, go download it and install it then come back to finish reading. 🙂 VS Code is a must-have in your toolbox and it is free! For those that are new to VS Code, it is an open-source – code editor developed by Microsoft that runs on Windows, Linux, and macOS. Here is a shortlist of the many benefits of VS Code:
- Has support for hundreds of languages.
- Has Integrated Terminal.
- Also powerful developer tool with functionality, like IntelliSense code completion and debugging.
- Includes syntax highlighting, bracket-matching, auto-indentation, box-selection, snippets, and more.
- Integrates with build and scripting tools to perform common tasks making everyday workflows faster.
- Has support for Git to work with source control.
- Large Extension Marketplace of third-party extensions.
Note that yes, VS Code is for the “IT Pro”. Not just developers.
Azure Extensions in VS Code
VS Code has a ton of extensions in general. There are a number of Azure specific extensions and you can work with Azure directly from VS Code.
If you go to the VS Code Marketplace here: https://marketplace.visualstudio.com/vscode and search on Azure you will see results for many published by Microsoft and many community based extensions for Azure. As of the time of writing this blog post, there are 93. Here is a screenshot showing some of the results:
You can also go directly to the Azure Tools extension from Microsoft here:
Azure Extensions from Microsoft here:
In the rest of this post, I am going to share some key extensions I use with Azure. I will post the marketplace links at the end of each extension I talk about and if it is maintained by community or Microsoft.
Deploy to Azure using VS Code
It is important to note that not all of the Azure extensions available in VS Code can be used to deploy to Azure. Some can but most can’t here is a list of the services that you can deploy to from extensions in VS Code.
|Azure Functions||Build and manage Azure Functions serverless apps directly in VS Code with the Azure Functions extension.|
|App Service||Manage Azure resources directly in VS Code with the Azure App Service extension.|
|Docker||Deploy your website using a Docker container.|
|Azure CLI||Create, deploy, and update a website using a terminal and the Azure CLI.|
|Static website||Create, deploy, and update a static website on Azure Storage.|
NOTE: This list is current at the time of writing this blog post. This will change over time.
Azure Cloud Shell in VS Code
Cloud Shell is something you should be using with Azure to make your life easier. It is an interactive command-line shell. You are authenticated to your Azure account when you launch it, It typically runs in the browser and is used for managing Azure resources. When you launch it you can choose the shell experience that best for you, either Bash or PowerShell. With VS Code you can launch Cloud Shell directly in VS Code!
Cloud Shell is a part of the Azure Account extension. Here are some key points on using Cloud Shell with VS Code:
- Free (storage consumed has costs.)
- Launch Azure Cloud Shell directly in VS Code.
- Launch Bash, PowerShell, or Upload.
- Works in the Integrated Terminal.
Azure and open-source Tooling in Cloud Shell:
|Azure Tools: |
blobxfer Azure CLI and Azure classic CLI Azure Functions CLI AzCopy Service Fabric CLI Batch Shipyard
Bash Terraform Packer Ansible Chef InSpec Puppet Bolt Docker Kubectl Helm DC/OS CLI iPython Client Cloud Foundry CLI
PowerShell Modules in Cloud Shell
|You get the following PowerShell modules in Cloud Shell: |
Azure Modules (Az.Accounts, Az.Compute, Az.Network, Az.Resources, Az.Storage)
Azure AD Management (Preview)
Exchange Online (In development)
Azure Account: https://marketplace
Maintained By Microsoft