Sample Deploying Multiple Azure ARM Templates Using External Links

In this post I’ll share a set of linked Azure ARM templates (link) that can be used to deploy a number of Azure resources together.  This sample uses externally linked ARM templates using a parent to child relationship as well as including a few “complex” scenarios like conditional logic and assigning permissions through role assignments.  Note there are also two ways to deploy these templates: 1) at the subscription level (owner) and 2) at the resource group level (contributor).

<Update 2019-04-09>After reading this article on ARM template lifecycle management do’s and dont’s I’m rethinking using externally linked ARM templates.  Below example still contains them but I may update to combine into a single ARM template at a later date once I’ve had a chance to test.</Update>

Background

For a recent customer project we had a need to deploy the following resources.

  • Resource group
    • Azure Storage Account
    • Azure Function App
      • Azure Application Insights
    • Azure Log Analytics workspace
    • Azure Automation Account

A few of these resources have dependencies on each other such as the Function App requiring a storage account to store solution data into blobs / queues, Automation Account requiring Log Analytics for pushing diagnostic stream data to a workspace, etc.  While it is possible to deploy all of these resources in one (very) large ARM template, we also wanted to be able re-use pieces and parts of this solution in future projects that are going to have a similar (but slightly different) architecture.  We decided to create a set of parent-child ARM templates to mimic the first 2 levels of the above hierarchy.

Solution

The sample files are stored in my Blog-Samples repo under the ARM-External-Templates folder.  There is a brief README file to walk through the necessary steps to update parameter files, upload the linked templates to a storage account, etc.  This is not a fully documented process at the moment but if you wish to submit a PR or open an issue I’ll update more as I have time.

A few key pieces to highlight.

  • The “Contributor” scenario assumes that the deployment account has contributor permissions to a specific resource group or subscription (more common for production or similar environments)
  • The “Owner” scenario assumes that the deployment account has owner permissions to the entire subscription (ex. development environment)
  • The “Owner” scenario optionally deploys role assignments (queue sender, workspace reader, and runbook operator) to various resources only if the corresponding parameter values are not empty (otherwise skip assignment)
  • The Automation Account is pre-populated with a PowerShell runbook and also configured to send runbook job and stream output to the provisioned log analytics workspace

Sample output

After running the deployment script the deployment and resource group should look as follows.

LinkedARMTemplates1.jpg

LinkedARMTemplates2.jpg

 

Conclusion

The linked ARM templates from this sample are meant for illustration purposes only.  Hopefully you’ll find them helpful in terms of what is possible from a deployment and configuration perspective.  If you have any feedback or suggestions please submit a PR on the repo or open an issue on GitHub.  Good luck with automating your Azure deployments.

 

-Frog Out

PowerShell Script to Find Connectors from PowerApps Apps

In this post I’ll share a script I developed for a customer to find which connectors are used by which PowerApps apps.  Currently this is not something available through the Power Platform Admin Center.  Feel free to use this script as you see fit.  This script is provided as-is without any warranties of any kind.  If you update or adapt it and decide to re-post please provide attribution.

Script

Note: If you do not see the below Gist please refer to code at this location: PS-Get_PowerApps_App_Connections.ps1


Add-PowerAppsAccount
$environments = Get-PowerAppEnvironment
foreach($environ in $environments.EnvironmentName)
{
$apps = Get-AdminPowerApp EnvironmentName $environ
$apps | Add-Member MemberType ScriptProperty Name Connections Value {$this.internal.properties.connectionReferences.PSObject.Properties.Value.DisplayName} Force
$apps | Select-Object AppName, DisplayName, Connections
}

Sample output

image.png

You may notice that the output contains a complex property for the Connections.  It has been some time since I worked with formatting output in PowerShell.  If you have an improvement to the formatting please share back suggestion and I’ll update the sample script.

-Frog Out

Looking Ahead To 2019

In this post I’ll look ahead at what I have coming up in 2019 and what I look to accomplish.

Background

In previous years I have typically blogged at the start and end of the year about my goals and retrospective.  In mid-2018 I started capturing a monthly retrospective (see How I Do A Personal Monthly Retrospective).  While I’m doing these personal retrospectives more frequently (monthly vs. yearly) they usually contain more personal things than I would feel comfortable sharing publicly.

Ahead in 2019

Baby number 3

The biggest thing I’m looking forward to in 2019 is that my wife Sarah and I are expecting our third child later this year.  We’re finally starting to share the news outside of our immediate family.  I’m very excited and happy that our family is growing and I look forward to sharing our love with our new baby.

Exercise

For the past several years I’ve been running a few 5k races, quarter marathon races, and obstacle course / mud runs.  This has been a good way to push myself to stay active and healthy.  This year I’ve already signed up for a 5k and an obstacle course race in the first half of the year.  I’ve already started training for both and it’s amazing how much better I feel physically and mentally after getting into a good workout routine.  I find that I have more energy and motivation to accomplish things and hope that I can keep this up in the coming months.

Faith life

My Catholic faith has always been a big part of my life, but this year especially is an important year as my wife is preparing to enter fully into the Catholic Church.  I’m proud to support her on her faith journey as well as continuing to raise our children in our shared faith.

Technical leadership

In 2018 I went through a program at Microsoft called Technical Leadership Development Program (TLDP).  The purpose of this program is to identify individual contributors (ICs, not a manager of people) and grow their technical leadership skills to make a bigger impact inside and outside the company.  While there were many takeaways from this program one of the big ones for me was the following progression of stages (starting at bottom and going up) for a technical leader:

Technical Leaders…

    • Stage 4 – Drive Impact Through Strategy
    • Stage 3 – Drive Impact Through Others
    • Stage 2 – Master Individual Impact
    • Stage 1 – Grow Individual Impact

 image

At the start of 2018 I would estimate that I was in the 2nd stage of mastering individual impact and not realizing (at the time) that the next stage was to move onto driving impact through others.  Note that this progression to stage 3 doesn’t require moving into people management.  Instead you can remain an individual contributor while still increasing impact through other people.  I tested the waters with this process through the 30 Days of Microsoft Graph blog series and a few other side projects.  I’m looking forward to continue this progression in 2019.

Reading books

Each year on average I read 2-4 books, usually during slow weeks around holidays when I can devote more attention.  In the past year I’ve found a number of great books in a number of topics including science fiction, religion, and technical leadership.  I should probably join a Good Reads program but have not done so yet.  Instead I usually end up hearing about a good book recommendation from a friend or coworker and then picking it up from the local library, borrowing from a friend, or similar.  I’m not always able to reserve time each day / week, but I do find that I sleep better when I read for at least 10+ minutes before going to bed.

Conclusion

These are the things I’m currently looking forward to in 2019.  Thanks to my mentor Sean McDonough for urging me to get this written.  I know much will change throughout this year, especially once baby #3 arrives.  Here’s to a successful start to the year and continued growth.  If you have your own goals or plans for the year please share in the comments.

-Frog Out