Setting up your Ubuntu 20.04 developer environment to build Azure solutions
This project is maintained by gloveboxes
Author | Dave Glover, Microsoft |
---|---|
Date | As at Mar 2020 |
This guide assumes you have some experience with Linux and you will open Terminal and Ctrl-Shift-V to paste in Bash commands.
Feel free to contribute to this guide.
Visual Studio Code is a must have IDE, open source, extensible, great language, debugging and tooling support.
Head to Visual Studio Code and download the .deb file for Debian and Ubuntu then install with QApt Package Installer.
sudo apt install neofetch htop
sudo apt install build-essential gdb cmake
There are a stack of great extensions for Visual Studio Code. These are the ones that I find most useful.
Before you can commit any changes against GitHub you’ll need to configure who you are.
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Snap install .NET Core 5
sudo snap install dotnet-sdk --classic --channel=5.0
sudo snap alias dotnet-sdk.dotnet dotnet
sudo ln -sv /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet
Confirm successful installation of .NET Core SDK
dotnet --version
References:
How to install Microsoft Azure Storage Explorer on Ubuntu
Install Azurite, a lightweight server clone of Azure Blob, Queue, and Table Storage that simulates most of the commands supported by it with minimal dependencies.
docker run -p 10000:10000 -p 10001:10001 mcr.microsoft.com/azure-storage/azurite
Notes.
Be sure that ‘curl’ is installed.
sudo apt install curl
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
Install Azure CLI 2.0 with apt
Code and test Azure Functions locally
Azure Functions Core Tools (note updated instructions for Ubuntu 18.04)
As at August 2018 see Install the Azure Functions Core Tools
cd ~/Downloads && \
sudo apt install curl -y
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update
sudo apt-get install azure-functions-core-tools
Install using the convenience script
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
To run Docker without root privileges, see Run the Docker daemon as a non-root user (Rootless mode).
To create the docker group and add your user:
sudo groupadd docker
sudo usermod -aG docker $USER
Followed with system reboot.
Docker Containers Tutorial – Persistent Storage Volumes and Stateful Containers
Create a new persistent storage volume in the Host Machine.
docker volume create azure-sql-edge-data
Inspect the storage volume to get more detailed information.
docker volume inspect azure-sql-edge-data
Check the data in the storage volume
sudo ls /var/lib/docker/volumes/azure-sql-edge-data/_data
Remove a docker data volume
docker volume rm azure-sql-edge-data
docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=<Your password>' --restart always -p 1433:1433 --name azuresqledge -v azure-sql-edge-data:/var/opt/mssql -d mcr.microsoft.com/azure-sql-edge
Northwind is a great starting point
Northwind and pubs sample databases for Microsoft SQL Server
Machine learning and AI with ONNX in SQL Edge
Use Visual Studio Code to create and run Transact-SQL scripts for SQL Server
Docker Containers Tutorial – Persistent Storage Volumes and Stateful Containers
Create a new persistent storage volume in the Host Machine.
docker volume create mysql-data
Inspect the storage volume to get more detailed information.
docker volume inspect mysql-data
Check the data in the storage volume
sudo ls /var/lib/docker/volumes/mysql-data/_data
docker run --name mysql1 -v mysql-data:/var/lib/mysql -e MYSQL_ROOT_HOST=% -e MYSQL_ROOT_PASSWORD="<Your Password>" --restart always -p 3306:3306 -d mysql/mysql-server
It is a free, easy-to-install package manager, environment manager and Python distribution with a collection of 1,000+ open source packages with free community support. Anaconda is platform-agnostic, so you can use it whether you are on Windows, macOS or Linux.
Create an Anaconda Navigator Desktop Resource
mkdir -p ~/.local/share/applications && \
cat > ~/.local/share/applications/anaconda-navigator.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Anaconda
Exec=/home/dave/anaconda3/bin/anaconda-navigator
Icon=/home/dave/anaconda3/lib/python3.6/site-packages/anaconda_navigator/static/images/anaconda-icon-256x256.png
Terminal=false
Type=Application
Categories=Development;
EOL
Notes.
If you want Tensorflow with GPU support for use with Python then by far the easiest way to install is with Anaconda as it will install the complete CUDA toolkit and cuDNN library into your selected environment. But note, this is community supported, and not officially supported.
Create the Anaconda environment
This would create a Anaconda environment with tensorflow-gpu support (requires an tensorflow capable nVida GPU, alternatively specify tersorflow-cpu), targeting Python 3.5, plus adds pylint useful in Visual Studio Code, and Jupyter Notebook support.
conda create -n <envName> python=3.5 tensorflow-gpu pylint scipy jupyter requests scikit-learn
Activate the Anaconda environment
Activate the Anaconda environment
source activate <envName>
Deactivate an Anaconda Environment
source deactivate
Anaconda Navigator is the easiest way to manage Anaconda environments and launch environments.
anaconda-navigator
Create your Python Project, open it with Visual Studio Code add a python file and select the Tensorflow environment you just created.
See
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.10.1-cp35-cp35m-linux_x86_64.whl pylint scipy
If your PC has a nVidia GPU and you want to developer with Docker and TensorFlow-GPU support. Simpler than installing CUDA Driver and Toolkit on to local system.
Notes.
For information on setting up CNTK Docker Containers.
Ensure the NVIDIA Container Runtime for Docker is installed.
nvidia-docker run -d -p 8888:8888 --name cntk-jupyter-notebooks -t microsoft/cntk
Start Jupyter Notebook server in your Docker container:
docker exec -it cntk-jupyter-notebooks bash -c "source /cntk/activate-cntk && jupyter-notebook --no-browser --port=8888 --ip=0.0.0.0 --notebook-dir=/cntk/Tutorials --allow-root"
Install library dependency
sudo apt install libgconf-2-4
Download and Install Postman
cd ~/Downloads && \
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz && \
sudo tar -xzf postman.tar.gz -C /opt && \
rm postman.tar.gz && \
sudo ln -s /opt/Postman/app/Postman /usr/bin/postman
Create Postman Desktop Resource
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/opt/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
EOL
Notes.
sudo apt-get install virtualbox
Microsoft Azure IoT extension for Azure CLI
az extension add --name azure-iot
Example IoT Hub command
az iot hub monitor-events --hub-name IotHubName
Notes.
If you are targeting ARM for your Docker builds then you will need to run the following command before you do your Docker build.
docker run --rm --privileged multiarch/qemu-user-static:register --reset
Notes.
Download from Fritzing Download Site.
I install in to a non system directory as Fritzing will complain that it doesn’t have access rights to create parts bins.
cd ~/Downloads && \
mkdir -p ~/Apps && \
tar -C $_ -xvjf fritzing-0.9.3b.linux.AMD64.tar.bz2 && \
sudo ln -s ~/Apps/fritzing-0.9.3b.linux.AMD64/Fritzing /usr/bin/fritzing
Create Fritzing Desktop Resource file
cat > ~/.local/share/applications/fritzing.desktop <<EOL
[Desktop Entry]
Version=0.9.3b
Name=Fritzing
GenericName=Fritzing
Comment=Electronic Design Automation software
Exec=fritzing
Icon=/home/dave/Apps/fritzing-0.9.3b.linux.AMD64/icons/fritzing_icon.png
Terminal=false
Type=Application
Categories=Development;IDE;Electronics;EDA;
X-SuSE-translate=false
StartupNotify=true
Categories=PCB;
MimeType=application/x-fritzing-fz;application/x-fritzing-fzz;application/x-fritzing-fzp;application/x-fritzing-fzpz;application/x-fritzing-fzb;application/x-fritzing-fzbz;application/x-fritzing-fzm;
EOL
How to Install Grub Customizer
How To Mount OneDrive In Linux Using Rclone
Access Windows 10 Sticky Notes via your browser - very handy for casual note taking