Open project-oagent-gh-app[bot] opened 1 month ago
The task requires a bash script that will fulfill the following:
Please, run the following as a bash script:
#!/bin/bash
# Bash Script to install Visual Studio Code, .NET Core SDK, and Azure CLI tool, and configure Azure VM
# Update package repositories
sudo apt update
# Install Visual Studio Code
sudo apt install -y code
# Install .NET Core SDK
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-sdk-3.1
# Install Azure CLI tool
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# Login to Azure CLI
az login
# Create a resource group for the VM
az group create --name myResourceGroup --location eastus
# Create a VM with custom data property
echo '#cloud-config
package_upgrade: true
packages:
- nginx' > cloud-init.txt
az vm create \
--resource-group myResourceGroup \
--name myVM \
--image UbuntuLTS \
--admin-username azureuser \
--generate-ssh-keys \
--custom-data cloud-init.txt
This script does the following:
Before you run this script, ensure that you have the necessary permissions to install software and create resources in Azure.
Write a script to install Visual Studio community edition, .NET Core SDK and the Azure CLI tool on your development machine.