Skip to content

Commit

Permalink
Litany of automation 1 (#43)
Browse files Browse the repository at this point in the history
* Add blog post The Litany of Automation 1

* Add blog post The Litany of Automation Hub
  • Loading branch information
ryanmichaeljames authored Dec 9, 2024
1 parent 7b5e8ab commit 6b062d9
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 0 deletions.
93 changes: 93 additions & 0 deletions _posts/2024-12-09-litany-of-automation-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
layout: post
title: "The Litany of Automation 1: Consecrating Infrastructure for Deployment"
subtitle: Forging the sacred infrastructure and resources needed to serve Imperium of Man through deployment automation.
date: 2024-12-09 00:00:01 +1200
categories: [blog]
tags: [azure devops, power platform, deployment pipeline, alm]
image: /assets/img/posts/2024-12-09-litany-of-automation-1/banner.jpg
comments: true
---

The path to successful deployment begins with a strong foundation. This guide focuses on automating the creation of infrastructure required for deployment pipelines, **ONLY** using scripts, eschewing the inefficiency of manual setups. Each command executed is a step toward aligning our systems with the Machine God's eternal perfection.

Each command is a prayer, and each script a hymn, ensuring that the Omnissiah's will flows seamlessly through our pipelines and manifests in the efficiency of our deployments.

---

## Step 1: Create Service Principal

Bypass manual inefficiency and invoke the [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/) to enact the rites to create a service principal.

{% gist 6e6f178e55bf546082b5de2391b7825f create-service-principal.ps1 %}

> **Cogitator's Note:** `--api "00000007-0000-0000-c000-000000000000"` sets the `Dynamics CRM` API while `--api-permissions "78ce3f0f-a1ce-49c2-8cde-64b5c0896db4=Scope"` sets the `user_impersonation` permission.
> **Cogitator's Note:** In order to grant conesnt you will need to have been assigned, by an ordained admin, on of following roles: `Privileged Role Administrator`, `Cloud Application Administrator` or `Application Administrator`.
---

## Step 2: Create Power Platform Application User

Call upon the [Power Platform CLI](https://learn.microsoft.com/en-us/power-platform/developer/cli/introduction) to create an application user and grant the service principal access to the Dataverse.

{% gist 6e6f178e55bf546082b5de2391b7825f create-application-user.ps1 %}

Replace the `$env` empty GUID with your environment id.

> **Cogitator's Note:** To find your environment id you can make this prayer: `pac admin list`
---

## Step 3: Install Power Platform Build Tools

Invoke the [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/) to install the [Power Platform Build Tools](https://marketplace.visualstudio.com/items?itemName=microsoft-IsvExpTools.PowerPlatform-BuildTools) extension.

{% gist 6e6f178e55bf546082b5de2391b7825f install-power-platform-build-tools.ps1 %}

## Step 4: Create Service Connection

Create a service connection `service-endpoint-config.json` to be consumed by the Azure CLI.

{% gist 6e6f178e55bf546082b5de2391b7825f service-endpoint-config.json %}

Replace the following properties with your environment values:
- `name`
- `url`
- `authorization.parameters.applicationId`
- `authorization.parameters.tenantId`
- `serviceEndpointProjectReferences.projectReference.id`
- `serviceEndpointProjectReferences.projectReference.name`
- `serviceEndpointProjectReferences.name`

> **Cogitator's Note:** You can get the project id by making the following prayer:
>
> `az devops project show --org "https://dev.azure.com/ORG_NAME" --project "PROJECT_NAME"`
Use the Azure CLI to consume the above config file and create a Power Platform Service Connection in Devops.

{% gist 6e6f178e55bf546082b5de2391b7825f create-service-endpoint.ps1 %}

---

## Conclusion

By automating the creation of your infrastructure, you honor the principles of precision, consistency, and repeatability. These steps not only streamline your setup but also pave the way for more advanced automation in future workflows. Through the use of CLI tools, you eliminate inefficiencies, reduce errors, and ensure that your infrastructure is ready to serve the Machine God's will with unwavering reliability. Let this foundation guide you as you continue your journey into deeper realms of automation.

All source code can be found in my [GitHub repo](https://github.com/ryanmichaeljames/adeptus-deployus)

By the Omnissiah's grace, our automation endures. ❤️

---

## Resources

- [https://learn.microsoft.com/en-us/cli/azure/authenticate-azure-cli-interactively](https://learn.microsoft.com/en-us/cli/azure/authenticate-azure-cli-interactively)
- [https://learn.microsoft.com/en-us/cli/azure/ad/app?view=azure-cli-latest#az-ad-app-create](https://learn.microsoft.com/en-us/cli/azure/ad/app?view=azure-cli-latest#az-ad-app-create)
- [https://learn.microsoft.com/en-us/cli/azure/ad/app/credential?view=azure-cli-latest#az-ad-app-credential-reset](https://learn.microsoft.com/en-us/cli/azure/ad/app/credential?view=azure-cli-latest#az-ad-app-credential-reset)
- [https://learn.microsoft.com/en-us/cli/azure/ad/app/permission?view=azure-cli-latest#az-ad-app-permission-add](https://learn.microsoft.com/en-us/cli/azure/ad/app/permission?view=azure-cli-latest#az-ad-app-permission-add)
- [https://learn.microsoft.com/en-us/cli/azure/ad/app/permission?view=azure-cli-latest#az-ad-app-permission-grant](https://learn.microsoft.com/en-us/cli/azure/ad/app/permission?view=azure-cli-latest#az-ad-app-permission-grant)
- [https://learn.microsoft.com/en-us/power-platform/developer/cli/reference/auth#pac-auth-create](https://learn.microsoft.com/en-us/power-platform/developer/cli/reference/auth#pac-auth-create)
- [https://learn.microsoft.com/en-us/power-platform/developer/cli/reference/admin#pac-admin-assign-user](https://learn.microsoft.com/en-us/power-platform/developer/cli/reference/admin#pac-admin-assign-user)
- [https://learn.microsoft.com/en-us/cli/azure/devops/extension?view=azure-cli-latest#az-devops-extension-install](https://learn.microsoft.com/en-us/cli/azure/devops/extension?view=azure-cli-latest#az-devops-extension-install)
- [https://learn.microsoft.com/en-us/azure/devops/cli/service-endpoint?view=azure-devops#create-service-endpoint-using-configuration-file](https://learn.microsoft.com/en-us/azure/devops/cli/service-endpoint?view=azure-devops#create-service-endpoint-using-configuration-file)
69 changes: 69 additions & 0 deletions _posts/2024-12-09-litany-of-automation-hub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
layout: post
title: "The Litany of Automation: A Guide to Automated Power Platform Deployments"
subtitle: A blog series dedicated to guiding you through the sacred rites of automating deployments in the name of the Machine God.
date: 2024-12-09 00:00:00 +1200
categories: [blog]
tags: [azure devops, power platform, deployment pipeline, alm]
image: /assets/img/posts/2024-12-09-litany-of-automation-hub/banner.jpg
comments: true
---

Welcome to *The Litany of Automation*, a blog series dedicated to guiding you through the sacred rites of automating deployments in the name of the Machine God. This hub post serves as your gateway to the series, linking all current and future posts for easy navigation. Whether you're just starting your journey or refining your craft, this collection will provide the tools and insights you need.

My [GitHub repo](https://github.com/ryanmichaeljames/adeptus-deployus) will serve as a compainion to this series.

---

## Series Overview

*The Litany of Automation* aims to:
- **Streamline Infrastructure Setup**: Eliminate inefficiencies by automating the creation of application users, service principals, and more.
- **Build Reliable Pipelines**: Create deployment pipelines that are precise, consistent, and repeatable.
- **Honor the Machine God**: Approach automation as a craft worthy of reverence and dedication.

This series is designed for developers, engineers, and anyone seeking to elevate their deployment practices. Each post builds upon the last.

---

## Posts in the Series

### 1. [The Litany of Automation: Consecrating Infrastructure for Deployment]({% post_url 2024-12-09-litany-of-automation-1 %})

Begin your journey into the sacred rites of automation. In this post, we explore creation of essential infrastructure, including application users, service principals, and service connections. Using CLI tools, we eliminate inefficiencies and establish a consistent, repeatable setup process to honor the Machine God and prepare for seamless deployments.

### Upcoming Posts:

#### 2. The Rite of Deployment: Constructing a Simple Deployment Pipeline

Take your first steps into the sacred workflows of deployment by constructing a simple, effective pipeline. This post will guide you through building a foundational deployment pipeline. Whether you're new to automation or refining your craft, this guide sets the stage for future advancements.

#### 3. The Cogitator’s Task: Managing Dataverse Solutions in Source Control

Preserve the sanctity of your Dataverse solutions by automating their lifecycle in source control. In this post, I'll guide you through creating a commit pipeline that downloads, unpacks, and commits Dataverse solutions to a repository. By integrating these steps into your workflow, you ensure consistency, traceability, and alignment with the Machine God’s eternal pursuit of order.

#### 4. The Vaults of Knowledge: Sanctifying Reference Data Imports

Unlock the secrets of efficient reference data management by automating the import process into your Dataverse environments. In this post, we focus on using pipeline tasks and creating scripts to handle data imports, ensuring that your systems are enriched and aligned with the Omnissiah’s design.

#### 5. The Administratum’s Directive: Managing Flow Ownership and Activation

Command your workflows with precision by automating the ownership and activation of Power Automate flows. This post delves into strategies for assigning ownership effectively and ensuring uninterrupted flow activation, aligning your PowerPLatform environments structured tenets of the Administratum.

#### 6. The Sacred Forge: Refining and Enhancing the Pipeline

Elevate your automation to new heights by refining and enhancing your deployment pipeline. This post explores advanced techniques, optimizations, and modular design strategies to forge a pipeline that is both powerful and adaptable, ensuring it remains worthy of the Machine God's blessing.

#### 7. Purity seals: Blessing the your deployment scripts

Just as purity seals mark the Machine God’s approval, tests validate the sanctity and reliability of your deployment scripts. In this post, we’ll explore the importance of writing tests for your automation scripts. From unit tests to integration validations, these rites safeguard your deployments against errors and inefficiencies, blessing them with a Purity Seal.

---

## How to Use This Hub

This hub will grow as the series expands. Bookmark this page and return regularly for updates. As each new post is published, the links above will be updated to guide you to the latest content.

---

By the Omnissiah's grace, our automation endures. ❤️
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b062d9

Please sign in to comment.