How Do You Invoke a class in a Groovy Program?

Problem scenario
You have a Groovy with these lines of code:

class Contint {
   static void main(String[] args) {
      def apple = {println “This is a basic test.”};
      apple.call();
   }
}
println “This is the second print statement in the code.”

The “Contint” class is never invoked.  What should you do?

Solution
Overview

You need to use the “new” reserved word.  This will instantiate the class. 

How Do You Create a Logic App without Using the Azure Portal Web UI?

Problem scenario
You want to create a Logic App without using the Azure Portal web UI.  What should you do?

Possible Solution #1
To get an overview of using an ARM template for a Logic App, you should read this article.

Possible Solution #2
If you have Visual Studio, you can use the Azure Logic Apps Tool for Visual Studio. 

How Do You Troubleshoot This Message “ImportError: No module named ‘google.cloud’?

Problem scenario
You run a Python program or from the Python command prompt you receive this message:

Traceback (most recent call last):
  File “main.py”, line 21, in <module
    from google.cloud import pubsub_v1
 ImportError: No module named ‘google.cloud’

ModuleNotFoundError: No module named ‘google’

What should you do to eliminate this problem?

Possible Solution #1
Try to run the program as sudo:

sudo python nameOfProg.py

Possible Solution #2
Try this with or without sudo (depending on whether or not you are using “sudo” to run the Python program):

sudo pip install google-cloud-bigquery

# You may or may not want to omit the “sudo” in the above command.

How Do You Troubleshoot Azure Template Files?

Problem scenario
You are having problems with your ARM templates (the .json files).  You want to learn more techniques at troubleshoot ARM templates. What should you do?

Possible Solution #1   Follow these directions on Microsoft’s website.
(You will need to download a .psm1 file and use the import-module command in PowerShell.)

Possible Solution #2
Clone this Git repo and use it to validate your ARM templates:  https://github.com/Azure/azure-arm-validator

Possible Solution #3
Substitute any very sensitive data from the JSON with dummy (fake or random) data. 

How Do You Troubleshoot the kubectl Error “Access denied status code: 403”

Problem scenario
You run a kubectl command but you get this error:

“could not get token: AccessDenied: Access denied
        status code: 403, request id:
Unable to connect to the server: getting credentials: exec: exit status 1″

What should you do?

Solution
The root cause is likely that your .kube directory has an incorrect configuration file. 

Possible Solution #1
If you are not using Amazon EKS,

How Do You Create the PowerShell Script, the Template.json and the Parameters.json Necessary to Utilize ARM?

Problem scenario
To use ARM templates you know know you should have three text files: 1) a PowerShell script 2) a template.json file and 3) a parameters.json file.

How do you create these for a given resource (e.g., a storage account, VM, or Function App)?

Solution
1.  In the Azure Portal web UI, start the process of creating a resource.  Right before you click “Create”,

How Do You Use an ARM Template to Create an Azure Serverless Function App?

Problem scenario
As a proof-of-concept you want to use an ARM template to create an Azure Function that uses Azure storage.  You want the template to create the Azure storage account as it is a dependency of the Azure Serverless Function (also known as an App Service).  How do you do this?

Overview
This will create an Azure Function also known as an App Service. 

How Do You Create a PowerShell Script to Create a Storage Account in Azure?

Problem scenario
You want to use an ARM template via a PowerShell script to create a storage account in Azure.  How do you do this?

Solution
Prerequisites

1.  If you are using Windows 7, you have installed Azure PowerShell; if you need assistance with this, see this posting.  If you are using Windows 10, you have installed the modules for Azure and the storage resource;

How Do You Install Azure PowerShell on Windows 10?

Problem scenario
You want to run ARM templates to declaratively create resources such as servers, databases, and subnets in Azure.  You need the PowerShell module for Azure to be installed for certain “reserved” words to work.  How do you install the Azure PowerShell?

Solution
1.  Open PowerShell as administrator.  (PowerShellGet is built into Windows 10 by default.  It may appear uninstalled, but it is natively part of the OS.)
2.