I’ll take a look at some of the cmdlets that are included in this initial release of the new Azure Functions module for PowerShell. The detailed tasks on this post using the module include: deploy a new function app, modify some of the settings using the Update cmdlets, and then clean-up-the-house by deleting the resources at the end.
Microsoft recently released on the PowerShell Gallery a module named
Az.Functions, offering cmdlets to manage the Azure Functions service. According to the PowerShell Gallery, version 1.0.0 was released on the 19th of May (the last version is 1.0.1, released on the 23rd of June).
Az.Functions is now included as part of the
Az module, wich provide a lot lot of additional modules like
Az.Compute, and more. So if you install the entire Az module, you’ll automatically receive Az.Functions by default.
Installing and analyzing Az.Functions
As introduced at the beginning, the module is now published in the PowerShell Gallery, so installation is a simple as starting a new PowerShell session and running one cmdlet, depending on what is required.
If you just want only the Az.Functions module, run the following cmdlet:
On the other hand, if you prefer to get all the Azure modules is required run:
Easy right? Now we let’s take a look at the cmdlets that are part of this module, so will execute:
Perfect! There are a lot of commands to work with Azure Functions from the comfort of the command line…
Deploy a new function app
Before we start creating a new function app, we must specify one of the supported locations based on the type of the function app. For example, if we like to create a Function App in a Consumption plan, we need to run the following command:
After choosing the location, we’ll create the required Azure resources for publish my function:
If the commands finish correctly, we received a confirmation on the console about the resource created.
Get functions and settings
We can use the
Get-AzFunctionApp function to check existent functions, filtering for subscriptions, resource group or names like this:
With the function app identified, we can manage settings or add news:
And get the value to use in future commands:
How about if I need to select only the previous setting created, named “Test”?:
An alternative to achieve that:
Wait… what is the method get_Item()? It’s a “hidden” method on hash tables.