How Do You Create a Linux Server in Azure with PowerShell When You Keep Getting an Error “Status Code: 400…Bad Request”?

Problem scenario
You are trying to create a Linux server in Azure with the Azure Tools for PowerShell.  You receive this message:

“Destination path for SSH public keys is currently limited to its default value due to a known issue in Linux provisioning agent.”

You see  “StatusCode: 400 … ReasonPhrase: Bad Request.”

What do you do to create an Ubuntu 16.x server and not get this error?

How Do You Install Maven, openjdk, libssl-dev, build-essential, and pkgconf on a RedHat 7.X or CentOS 6.X Linux Server?

Problem scenario
You are using a RedHat derivative distribution of Linux (e.g., CentOS/RHEL/Fedora).  To eliminate a Hadoop error, you need to install a variety of packages.  How do you install Maven, openjdk, libssl-Dev, build-Essential, and pkgconf?

Solution
To install Maven, see this article.

For the rest of the packages, run these commands:

sudo yum -y install java-1.8.0-openjdk-devel openssl-devel cmake protobuf

sudo yum -y groupinstall ‘Development Tools’

curl ftp://rpmfind.net/linux/fedora/linux/updates/25/x86_64/p/pkgconf-1.3.7-1.fc25.x86_64.rpm pkgconf-1.3.7-1.fc25.x86_64.rpm

curl ftp://rpmfind.net/linux/fedora/linux/updates/25/x86_64/l/libpkgconf-1.3.7-1.fc25.x86_64.rpm libpkgconf-1.3.7-1.fc25.x86_64.rpm

sudo rpm -ivh *.rpm …

How Do You Create a Certificate Signing Request (CSR) File and Set up an HTTPS Server for Basic Testing?

Problem scenarios
This is a two-in-one posting.  The same solution works for two different problem scenarios.

Problem scenario A
You want to create a certificate signing request permissions file (a csr.pem) to learn more about it.  You also want to try to use HTTPS as a test.  How do you do these things?

Problem scenario B
You want to implement a solution with TLS. 

How Do You Find What Resource Groups You Have with Azure PowerShell?

Problem scenario
You want to find the resource groups in your Azure account.  Either you have already installed Azure PowerShell on Windows 7 or on Windows 10 you have installed the Azure modules.  You have connected to an Azure account (e.g., with this command Login-AzureRMAccount). What is the PowerShell command to list the resource groups in the Azure account?

Solution
Run this command:
Find-AzureRmResourceGroup

# It will work with the Azure Cloud Shell too.

How Do You Write a Python Program That Can Run Linux Bash Commands?

Problem scenario
You want to use Python to run Linux commands.  You have been told to not use the “import os” for this task.  You want to manipulate the text and output of Bash commands for sophisticated processing and automation with Python.  How can a Python program run Bash commands?

Solution
Use “from subprocess import check_output” as the first line.  Then encapsulate the Bash command inside double quotes,

How Do You Troubleshoot the Problem “ImportError: Entry Point (‘console_scripts’, ‘Parquet’) Not Found”?

Problem scenario
You are trying to run Apache Parquet commands.  But each command gives this error:

Traceback (most recent call last):
  File “/usr/local/bin/parquet”, line 11, in <module>
    load_entry_point(‘parquet==1.2’, ‘console_scripts’, ‘parquet’)()
  File “/home/ubuntu/.local/lib/python2.7/site-packages/pkg_resources/__init__.py”, line 570, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File “/home/ubuntu/.local/lib/python2.7/site-packages/pkg_resources/__init__.py”, line 2750, in load_entry_point
    raise ImportError(“Entry point %r not found” % ((group, name),))
ImportError: Entry point (‘console_scripts’,

How Do You Use PowerShell on Your Desktop to Manage Azure?

Problem scenario
You want to use PowerShell on your local machine to create, delete, and restart servers in Azure.  You want to do other things with Azure using PowerShell on your workstation.  What do you do?

Solution
1.  To run Azure commands from your desktop, you need to connect your PowerShell ISE with your Azure instance.  If you are using Windows 10, see this posting and ignore this set of directions here entitled “How Do You Use PowerShell on Your Desktop to Manage Azure?” 

How Do You Create an Ubuntu Linux VM in Azure Using PowerShell Azure?

Updated 1/12/19

Problem scenario
You want to create an Ubuntu Linux server with one vCPU and one GB of RAM in Azure using PowerShell.  You want to use Azure Resource Manager (an ARM template).  You do not want to use the Azure Portal for 95% of the work involved.  What do you do to automate the process (including the deployment of a resource group, a network security group,

How Do You Run a MapReduce Job (with Python)?

Problem scenario
You have studied what a MapReduce job is conceptually.  But you want to try it out.  You have a Linux server with the Hadoop namenode (aka master node) installed on it.  How do you run a MapReduce job [to understand what it is all about]?

Solution
This is just an example.  We tried to make this as simple as possible.  This assumes that Python has been installed on the Hadoop namenode (aka master node) running on Linux.

How Do You Pass Parameters Using Boto?

Problem scenario
You want to run a Boto program. But there is an error about necessary parameters not being assigned.

You see a message like this:

botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the CreateStack operation: Parameters: [KeyName, DBPassword, DBUser] must have values

Where can you see an example of parameters being passed?

Solution
Updated on 3/15/21.