Translate

Sunday, March 14, 2021

Azure - starting dev on Linux



Some notes to start to work with Azure on a Linux system






Azure CLI

Like AWS, Azure has a CLI interface that can be installed on a local machine to facilitate the development of functions/applications, helping to control the Azure environment for a project

The installation is quite simple since Microsoft maintains a script that facilitate it.

Just open a terminal and execute : 

curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

After the installation is necessary to login to an Azure account.

Open a terminal and execute : 

az login

A browser will open to log in and then redirect back to the terminal.

Here a login example :

$ az login

The default web browser has been opened at https://login.microsoftonline.com/common/oauth2/authorize.
Please continue the login in the web browser. 

If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.

Opening in existing browser session.

You have logged in. Now let us find all the subscriptions to which you have access...

[
  {
    "cloudName": "AzureCloud",
    "homeTenantId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "isDefault": true,
    "managedByTenants": [],
    "name": "Azure subscription 1",
    "state": "Enabled",
    "tenantId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "user": {
      "name": "user@email.com",
      "type": "user"
    }
  }
]


Azure Core Tools 2.0

This is a tool collection to be used on the local machine for development of functions in Azure.

To install them use npm : 

npm install -g azure-functions-core-tools@core

 

Azure Studio

In order to connect and work on MS database is handy to have a GUI application capable to connect and work on the tables of a database.

Microsoft has such tools for MS SQL database called Azure Studio.

Installing Azure Studio on Linux is relatively straightforward.

First download the latest version for the distro.

There are 3 types of files : 

.deb  → Debian/Ubuntu

.rpm → CentOS/Fedora

.tar.gz  → universal

Since the target is Ubuntu is easier to download the .deb file then install it using the default Ubuntu installer.


Fixing problems

This section is to document some fixing problems.


IntelliJ Idea - Warning about missing plugin

During the package or run or deployment a warning did come up :

[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.xxxxxxxxxxxxxxxxxxxxxxtest:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 273, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 

It was a strange warning since the code was built and actually packaged/run or deployed.

Searching around I did find a not saying that often this problem is due because in the pom file is missing the version for the specific plugin.

It was indeed the case, so I did add a version :

(from this)

           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile<

(to this)

           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile<

To find the version is possible to go to the Maven repository website and search there.

No comments:

Post a Comment