One thing which is really important for using cloud infrastructures is to automate your tasks like starting virtual machines, creating storage, ...
It is clear, that there is a CLI for Windows, but is there also a CLI on Linux provided by Microsoft?
And really there is one:
https://docs.microsoft.com/de-de/cli/azure/?view=azure-cli-latest
The installation procedure can be found
here.
# apt-get install apt-transport-https lsb-release software-properties-common dirmngr -y
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
lsb-release ist schon die neueste Version (9.20170808ubuntu1).
dirmngr ist schon die neueste Version (2.2.4-1ubuntu1.2).
Die folgenden Pakete werden aktualisiert (Upgrade):
apt-transport-https python3-software-properties software-properties-common software-properties-gtk
4 aktualisiert, 0 neu installiert, 0 zu entfernen und 173 nicht aktualisiert.
Es müssen 87,2 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 2.048 B Plattenplatz zusätzlich benutzt.
Holen:1 http://de.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 apt-transport-https all 1.6.8 [1.692 B]
Holen:2 http://de.archive.ubuntu.com/ubuntu bionic-updates/main amd64 software-properties-common all 0.96.24.32.7 [9.908 B]
Holen:3 http://de.archive.ubuntu.com/ubuntu bionic-updates/main amd64 software-properties-gtk all 0.96.24.32.7 [53,6 kB]
Holen:4 http://de.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3-software-properties all 0.96.24.32.7 [22,0 kB]
Es wurden 87,2 kB in 0 s geholt (427 kB/s).
(Lese Datenbank ... 421429 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../apt-transport-https_1.6.8_all.deb ...
Entpacken von apt-transport-https (1.6.8) über (1.6.6ubuntu0.1) ...
Vorbereitung zum Entpacken von .../software-properties-common_0.96.24.32.7_all.deb ...
Entpacken von software-properties-common (0.96.24.32.7) über (0.96.24.32.6) ...
Vorbereitung zum Entpacken von .../software-properties-gtk_0.96.24.32.7_all.deb ...
Entpacken von software-properties-gtk (0.96.24.32.7) über (0.96.24.32.6) ...
Vorbereitung zum Entpacken von .../python3-software-properties_0.96.24.32.7_all.deb ...
Entpacken von python3-software-properties (0.96.24.32.7) über (0.96.24.32.6) ...
apt-transport-https (1.6.8) wird eingerichtet ...
# echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" > /etc/apt/sources.list.d/azure-cli.list
# apt-key --keyring /etc/apt/trusted.gpg.d/Microsoft.gpg adv \
> --keyserver packages.microsoft.com \
> --recv-keys BC528686B50D79E339D3721CEB3E94ADBE1229CF
Executing: /tmp/apt-key-gpghome.D49hIjQpQ5/gpg.1.sh --keyserver packages.microsoft.com --recv-keys BC528686B50D79E339D3721CEB3E94ADBE1229CF
gpg: Schlüssel EB3E94ADBE1229CF: Öffentlicher Schlüssel "Microsoft (Release signing) " importiert
gpg: Anzahl insgesamt bearbeiteter Schlüssel: 1
gpg: importiert: 1
# apt-get update && apt-get install azure-cli
Die folgenden NEUEN Pakete werden installiert:
azure-cli
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 173 nicht aktualisiert.
Es müssen 43,9 MB an Archiven heruntergeladen werden.
Nach dieser Operation werden 398 MB Plattenplatz zusätzlich benutzt.
Holen:1 https://packages.microsoft.com/repos/azure-cli bionic/main amd64 azure-cli all 2.0.56-1~bionic [43,9 MB]
Es wurden 43,9 MB in 7 s geholt (5.905 kB/s).
Vormals nicht ausgewähltes Paket azure-cli wird gewählt.
(Lese Datenbank ... 421429 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../azure-cli_2.0.56-1~bionic_all.deb ...
Entpacken von azure-cli (2.0.56-1~bionic) ...
azure-cli (2.0.56-1~bionic) wird eingerichtet ...
After that i tried to login:
schroff@zerberus:~$ az login
Note, we have launched a browser for you to login. For old experience with device code, use "az login --use-device-code"
You have logged in. Now let us find all the subscriptions to which you have access...
[
{
"cloudName": "AzureCloud",
"id": "yyyy-xxxxx",
"isDefault": true,
"name": "Free Trial",
"state": "Enabled",
"tenantId": "yyyyy-xxxxxx",
"user": {
"name": "d.schroff@gmx.de",
"type": "user"
}
}
]
Within the login process i was redirected to my browser:
and after choosing my account the browser showed up with this message:
And then you can issue commands like:
schroff@zerberus:~$ az vm list
[
{
"additionalCapabilities": null,
"availabilitySet": null,
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,