<commit_before>---
layout: article
title: 'ARM Lab 3: Functions and secrets'
date: 2018-04-17
categories: null
tags: [authoring, arm, workshop, hackathon, lab, template, references, secrets]
comments: true
author: Richard_Cheney
---

{% include toc.html %}

## Introduction

You should now be fairly comfortable working with JSON templates and parameter files, leveraging the various sources of ARM template, and refactoring variables and parameters and resources to customise the files for your requirements.

In this lab we will look at:

* ARM functions
* referencing information
    * for the current deployment
    * for resources that already exist
* handling secrets with securetext

These are all fairly common as you get more ambitious with your own templates or start using some of the more complex templates that are on the GitHub repository.


## ARM Functions

But before we start moving through those areas, let's take a deeper look at the wealth of functions that are available to the ARM templates.  We'll start to see more of them as we work through the various sections of the lab so it is worth spending some time to understand that range of capability.

The documentation for the ARM template functions is one of those areas that you will visit often, and so we come to our third important short URL:

[**aka.ms/armfunc**](https://aka.ms/armfunc){:target="_blank" class="btn-info"}

We'll now step through some of the functions available to ARM templates, and how they can be used.  This will not cover all of them, as the [documentation](https://aka.ms/armfunctions) for the templates is pretty good, so if you need to understand something trivial like how to trim a string with whitespace then dive in to that area and dig out the information.

The functions are split into seven groups:

**Function Group** | **Use Case**
[Array and Object](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-array) | used to manipulate or test JSON arrays and objects
[Comparison](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-comparison) | which are a group of test operators used by the **condition** function
[Deployment](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-deployment) | which covers those related to the deployment job, e.g. the parameters and variables functions
[Logical](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-logical) | which are a group used in logical expressions, such as _if_,  _and_ and _or_, or converting strings to booleans<commit_msg>Duplicate lines<commit_after>---
layout: article
title: 'ARM Lab 3: Functions and secrets'
date: 2018-04-17
categories: null
tags: [authoring, arm, workshop, hackathon, lab, template, references, secrets]
comments: true
author: Richard_Cheney
---

{% include toc.html %}

## Introduction

You should now be fairly comfortable working with JSON templates and parameter files, leveraging the various sources of ARM template, and refactoring variables and parameters and resources to customise the files for your requirements.

In this lab we will look at:

* ARM functions
* referencing information
    * for the current deployment
    * for resources that already exist
* handling secrets with securetext

These are all fairly common as you get more ambitious with your own templates or start using some of the more complex templates that are on the GitHub repository.

## ARM Functions

But before we start moving through those areas, let's take a deeper look at the wealth of functions that are available to the ARM templates.  We'll start to see more of them as we work through the various sections of the lab so it is worth spending some time to understand that range of capability.

The documentation for the ARM template functions is one of those areas that you will visit often, and so we come to our third important short URL:

[**aka.ms/armfunc**](https://aka.ms/armfunc){:target="_blank" class="btn-info"}

We'll now step through some of the functions available to ARM templates, and how they can be used.  This will not cover all of them, as the [documentation](https://aka.ms/armfunctions) for the templates is pretty good, so if you need to understand something trivial like how to trim a string with whitespace then dive in to that area and dig out the information.

The functions are split into seven groups:

**Function Group** | **Use Case**
[Array and Object](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-array) | used to manipulate or test JSON arrays and objects
[Comparison](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-comparison) | which are a group of test operators used by the **condition** function
[Deployment](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-deployment) | which covers those related to the deployment job, e.g. the parameters and variables functions
[Logical](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-logical) | which are a group used in logical expressions, such as _if_,  _and_ and _or_, or converting strings to booleans
{'fraction_non_alphanumeric': 0.07486430844095078, 'fraction_numerical': 0.003368893879842785, 'mean_word_length': 4.777297297297297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3498319', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1302, 'n_words': 670}