<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jason Phillips</title>
    <description>The latest articles on DEV Community by Jason Phillips (@raisingcode).</description>
    <link>https://dev.to/raisingcode</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F230250%2F6c1981b2-8860-4c0f-bd84-fb1316e8d48a.jpeg</url>
      <title>DEV Community: Jason Phillips</title>
      <link>https://dev.to/raisingcode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raisingcode"/>
    <language>en</language>
    <item>
      <title>IaC with Excel</title>
      <dc:creator>Jason Phillips</dc:creator>
      <pubDate>Tue, 24 Feb 2026 03:04:19 +0000</pubDate>
      <link>https://dev.to/raisingcode/iac-with-excel-16hh</link>
      <guid>https://dev.to/raisingcode/iac-with-excel-16hh</guid>
      <description>&lt;h1&gt;
  
  
  The Infrastructure as Code Dilemma: What If Excel WAS the IaC?
&lt;/h1&gt;

&lt;p&gt;As organizations adopt Infrastructure as Code (IaC), operations teams face a dilemma: they need to deploy infrastructure using Terraform, ARM, or Bicep, but they aren't developers. What if the solution was already sitting on everyone’s desktop?&lt;/p&gt;




&lt;h2&gt;
  
  
  The Infrastructure as Code Dilemma
&lt;/h2&gt;

&lt;p&gt;Your infrastructure team needs to deploy 50 new VMs. They know networking, storage, and security inside out, and the requirements are perfectly documented in an Excel spreadsheet. &lt;/p&gt;

&lt;p&gt;The problem? DevOps insists on "proper IaC practices." But seasoned IT pros usually don't speak HashiCorp Configuration Language. &lt;/p&gt;

&lt;p&gt;Currently, the deployment process is broken. Ops plans in a spreadsheet, DevOps spends days translating it into Terraform, requirements change, and the cycle repeats. When this bottleneck gets too painful, teams resort to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ClickOps:&lt;/strong&gt; Manually clicking through the Azure Portal 100 times.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fragile Scripts:&lt;/strong&gt; Hacking together PowerShell or Python from CSV exports that break when APIs change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Copy-Paste Marathons:&lt;/strong&gt; Duplicating last month’s deployment and hoping nothing breaks.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Real-World Bottleneck
&lt;/h2&gt;

&lt;p&gt;Whether building massive 100-VM lab environments or migrating dozens of enterprise applications, the pattern is the same. Application and Ops teams know exactly what they need, but they can't deploy it themselves. &lt;/p&gt;

&lt;p&gt;Every deployment goes into a DevOps queue. Every change requires rewriting Terraform. Velocity is measured in weeks, not hours. &lt;/p&gt;

&lt;h3&gt;
  
  
  What If Excel WAS the Infrastructure as Code?
&lt;/h3&gt;

&lt;p&gt;We’re fighting the wrong battle by forcing Ops teams to learn developer tools. Teams gravitate toward Excel for planning. What if we met them where they already are? &lt;/p&gt;

&lt;p&gt;What if you could fill out an Excel spreadsheet and just click “Deploy”?&lt;/p&gt;




&lt;h2&gt;
  
  
  Introducing ExcelAsCode
&lt;/h2&gt;

&lt;p&gt;ExcelAsCode is an open-source Excel template that generates Infrastructure as Code directly from spreadsheets. No Python scripts to maintain. No complex workflows. Just Excel with deployment superpowers. &lt;/p&gt;

&lt;h3&gt;
  
  
  How It Works
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Download:&lt;/strong&gt; Get the file from &lt;a href="https://github.com/raisingcode/excelascode" rel="noopener noreferrer"&gt;raisingcode/excelascode&lt;/a&gt; and enable macros (which safely call Azure APIs).&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Authenticate:&lt;/strong&gt; Securely connect to your Azure tenant using OAuth 2.0 device code flow.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Use Live Dropdowns:&lt;/strong&gt; The template makes live API calls to populate dropdowns with your actual Azure regions, VM SKUs, OS images, and networks. No typos, no guessing.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Fill in Requirements:&lt;/strong&gt; Dedicate one row per VM. Add custom columns for cost centers and use standard Excel formulas to calculate IOPS or pricing.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Generate Code:&lt;/strong&gt; Click "Generate Terraform" or "Generate ARM." The tool validates inputs and creates modular, production-ready IaC files.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Deploy or Review:&lt;/strong&gt; Click “Deploy to Azure” to provision immediately, or export the files to commit to Git for your CI/CD pipeline.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Core Use Cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Application Migration at Scale:&lt;/strong&gt; Turn application owner requirements directly into production-ready code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance Testing:&lt;/strong&gt; Model 100+ VM test matrices with cost-calculating formulas before bulk deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disaster Recovery:&lt;/strong&gt; Clone environment configurations and swap region parameters in seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bulk Infrastructure Deployment:&lt;/strong&gt; Replace manual portal clicks with a “fill once, deploy many” workflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-Deployment Validation:&lt;/strong&gt; Verify costs and regional capabilities before spinning up resources.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;ExcelAsCode is open-source, and community feedback is vital. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Access the Project:&lt;/strong&gt; Download the template and docs at &lt;a href="https://github.com/raisingcode/excelascode" rel="noopener noreferrer"&gt;https://github.com/raisingcode/excelascode&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Support &amp;amp; Feedback:&lt;/strong&gt; Submit bugs, feature requests, or cloud provider suggestions via GitHub Issues.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>terraform</category>
      <category>infrastructureascode</category>
      <category>bicep</category>
      <category>azure</category>
    </item>
    <item>
      <title>5 PowerShell Modules You Should Know About</title>
      <dc:creator>Jason Phillips</dc:creator>
      <pubDate>Tue, 28 Jul 2020 03:59:11 +0000</pubDate>
      <link>https://dev.to/raisingcode/5-powershell-modules-you-should-know-about-5g88</link>
      <guid>https://dev.to/raisingcode/5-powershell-modules-you-should-know-about-5g88</guid>
      <description>&lt;p&gt;We all know the possibilities powershell can offer from automation, to cloud, to system administration.&lt;/p&gt;

&lt;p&gt;The large variety of from modules have amplified powershell’s capability. Here are a few essential modules and a few light-weight examples of using them in action.&lt;/p&gt;

&lt;h1&gt;
  
  
  I. Import-Excel
&lt;/h1&gt;

&lt;p&gt;Import-Excel is a powershell module that provides functions to generate excel workbooks. If you need something a little more advanced the “old csv file.” You can format, add pivots, and more&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Import-Module "importexcel"

$path = ".\output-file.xlsx"
$excelfile = Export-Excel  $path -Passthru -AutoSize -WorksheetName "Worksheet 1"

$row=1

$ws.Cells["A$row"].value ="Subscription"
$ws.Cells["B$row"].value ="ResourceGroup"
$ws.Cells["C$row"].value = "PreTaxCost"
$ws.Cells["D$row"].value = "Currency"

# Fill the background-color
Set-ExcelRange -Worksheet $ws -Range $ws.Cells["B$row"] -BackgroundColor Cyan -Bold 
Set-ExcelRange -Worksheet $ws -Range $ws.Cells["C$row"] -BackgroundColor Cyan -Bold
Set-ExcelRange -Worksheet $ws -Range $ws.Cells["D$row"] -BackgroundColor Cyan -Bold 


$excelfile.Save()
$excelfile.Dispose()

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;
  
  
  II. addsadministration
&lt;/h1&gt;

&lt;p&gt;addsadministration is ActiveDirectory Powershell module used to quickly commands to active directory like add users and groups. Honestly, I dont know how anyone could administer AD with out this powershell module. Unlike most module availabile on powershell gallery. You either need to running a windows server or install the RSAT&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import-module aadsadministration

 New-ADUser -Name "ChewDavid" -OtherAttributes @{'title'="director";'mail'="chewdavid@fabrikam.com"}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;
  
  
  III. AzSK
&lt;/h1&gt;

&lt;p&gt;Azure Devops Security Kit (or better known by its module name as AzSK) offers plethora of tools and applications for securing your azure subscription resources from the subscription level, development, or ci/cd pipeline.&lt;/p&gt;

&lt;p&gt;For example, to validate your arm template for any security vulnerabilities and validate it will meet compliance best-practices&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Import-Module AzSK
Get-AzSKARMTemplateSecurityStatus –ARMTemplatePath &amp;lt;Path to ARM Template&amp;gt;  -UseBaselineControls
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RSfZYMaM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/697jwmf86ky4d35blrmt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RSfZYMaM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/697jwmf86ky4d35blrmt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The result is the output of the arm template checker for an appservice arm template I was planning to deploy.&lt;/p&gt;

&lt;p&gt;This is just the tip of iceberg. You can inspect your entire subscription or resource group with this powershell module as well.&lt;/p&gt;

&lt;h1&gt;
  
  
  IV. Universal Dashboard
&lt;/h1&gt;

&lt;p&gt;Universal Dashboard is a website/webframework for powershell that allows teams to quickly develop websites, restful apis , dashboards all while leveraging a modern ui underneath the covers.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#simple hello-name example

install-module universaldashboard  -Scope CurrentUser
import-module universaldashboard

#lets output a simple request
$hellopage = New-UDPage -Url "/Hello/:name" -Endpoint {
    param($name)
    New-UDLayout -Columns 2 -Content {  
    New-UDCard -Id "DataCard"  -Content {

     New-UDMonitor -Title "Downloads per second" -Type Line -Endpoint {
     Get-Random -Minimum 0 -Maximum 10 | Out-UDMonitorData
        }
     }
    New-UDCard -Title "Hello $name" -Id "PageCard"
}
}

#add the page to the dashboard object
$dashboard = New-UDDashboard -Pages @($hellopage)

#Change the -port to anything; I'm using 1005
Start-UDDashboard -dashboard $dashboard -port 1005
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After running powershell, if you go to &lt;a href="http://localhost:1005/hello/name"&gt;http://localhost:1005/hello/name&lt;/a&gt;, you should get response back.&lt;/p&gt;

&lt;p&gt;Its important to note their is a community (free) and enterprise version of this module use the Install-Module -Name UniversalDashboard.Community when installing&lt;/p&gt;

&lt;h1&gt;
  
  
  V. WriteAscii
&lt;/h1&gt;

&lt;p&gt;Need a cool splash logo at the console. Checkout write ascii. Available in the PSGallery&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Import-Module writeascii
"Hello World" | writeascii -foreground cyan
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vlBP_UGS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9xwpc8w2bfmp986929jg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vlBP_UGS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9xwpc8w2bfmp986929jg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Hopefully, if you’re using PowerShell pretty consistently in your day I hope this post was hopeful; be it work or as a hobby. It’s worth mentioning that most of these gems are generated by the dedicate community of powershell users. Feel free to share your most useful powershell modules you use.&lt;/p&gt;

</description>
      <category>powershell</category>
      <category>scripting</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Using Github Actions to Deploy Arm Templates</title>
      <dc:creator>Jason Phillips</dc:creator>
      <pubDate>Fri, 05 Jun 2020 05:07:48 +0000</pubDate>
      <link>https://dev.to/raisingcode/using-github-actions-to-deploy-arm-templates-544m</link>
      <guid>https://dev.to/raisingcode/using-github-actions-to-deploy-arm-templates-544m</guid>
      <description>&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;Github Actions are one of the fairly newer tools that have entered into the CI/CD tool arena. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is CI/CD?
&lt;/h2&gt;

&lt;p&gt;The term refers to Continous Integration/Continuous Deployment. Although the terms are coupled together there different. Continuous integration is process of building code and ensuring passes the intergration and code quality of other components in the system. Continous Deployment are tools/process that allow for continous deployment of code. &lt;/p&gt;

&lt;h3&gt;
  
  
  CI/CD with ARM Templates
&lt;/h3&gt;

&lt;p&gt;ARM templates are one of many approaches to building Azure Resources (VMs, appservices, vnets, xyz) as code or (json template) and allowing software engineering principles to improve the quality of deployments in the cloud.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Github Actions?
&lt;/h2&gt;

&lt;p&gt;I would point out Github Actions are still pretty lightweight. Gitlab Runners and Azure Pipelines pack on additional tools such as manual deployments, pipeline stages, approvals etc. So if you need one of those you may have to migrate to something more enterprise but its Github Actions meets a lot scenarios today. &lt;/p&gt;

&lt;p&gt;There are certainly a lot of pros. You now have a single location that can houses your source code management and you're CI/CD pipeline.&lt;/p&gt;

&lt;p&gt;Another pro with using Github Actions, is there numerous positive community contributions. There are a plethora plugins/marketplace connectors for your deployment simplifying the amount lines you need to script out. You'll see an example of that in later.&lt;/p&gt;




&lt;h1&gt;
  
  
  What you need
&lt;/h1&gt;

&lt;p&gt;I will walk through setting up a quick Azure Resource Manager (ARM) deployment with Github Actions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Github Account&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Access to an Azure Subscription as Owner Role&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Owner Role will allow us to create a resource group and assign roles/permissions to it; we also need a service principal for workflow to run as&lt;/li&gt;
&lt;li&gt;In Azure AD, the account your using has appropriate permissions to create a service principal 

&lt;ul&gt;
&lt;li&gt;User is typically good enough unless permissions were customized in AD (see this &lt;a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#required-permissions" rel="noopener noreferrer"&gt;Required permissions for Service Principals&lt;/a&gt; )*&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Azure CLI or Cloud Shell Access&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;




&lt;h1&gt;
  
  
  Setting Up the Azure Environment
&lt;/h1&gt;

&lt;p&gt;We will create the following*:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Resource Group to deploy our ARM Templates in GitHub Actions&lt;/li&gt;
&lt;li&gt;Service Principal Created that has contributor role to create resources in a Resource Group&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;*Note: If you have already identified a resource group and service principal created with contributor access, please go to the next step&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a resource group
&lt;/h2&gt;

&lt;p&gt;Azure CLI Commands&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az login
az group create --name lab_resourcegroup --location eastus2
~~~
The first command authenticates us in azure with will be assumed has been been done before running the remainder of commands. It's assumed you're running &amp;lt;b&amp;gt;az login&amp;lt;/b&amp;gt; using an account with Owner Role at the subscription and Azure AD Permission to create the Service Principal

I'm using location with eastu2 but feel free to use region thats closest to you.

## Create the Service Principal

Azure CLI Commands
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;az ad sp create-for-rbac -n "gha_administrator" --sdk-auth&lt;br&gt;
~~~~&lt;br&gt;
The output will be simular below save this information for later &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8prkxsbt4he4ilghlov6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8prkxsbt4he4ilghlov6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Assign contributor role to Service Principal for the resource group
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az role assignment create --assignee [clientId from previous output] --role contributor --resource-group lab_resourcegroup
~~~~
## Next Steps
Now that we have the resource group, service principal, and role assignments setup in Azure, we can move on to setting up github.



# GitHub Setup Steps for CI/CD
In this step, we will:
- Set up a new Github Repo
- Download a simple linux vm arm template for Microsofts ARM repo
- Create a github action workflow
- Commit and push changes to the remote branch

## Set up the Github Repo
- Log into Github
- Create a new repo
- Call it "GHActions" 

  *_Note: If you haven't done this in while, there will be a plus icon near the top-right right-corner; click that, then click "New repository"_

&amp;lt;img src='https://dev-to-uploads.s3.amazonaws.com/i/ge4gd0pi2bxmyxu6o76z.png' style='width:200px; height:75px' /&amp;gt;

- On your local system, clone the repo, just created from above

~~~
git clone https://github.com/[your username]/GHActions.git
~~~

&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Warning: If you receive errors such as command not found, it is likely git is not installed in your environment. Please click here to download [https://git-scm.com/downloads](https://git-scm.com/downloads)&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;

## Download the sample ARM Template
There are plethora of ARM Templates that can easily be accessed for Azure-QuickStart-Template repo [https://github.com/Azure/azure-quickstart-templates]

For the the Github Action Workflow, we're going go use a simple VM template. 

Download two files from Azure-Quick Start Repo and save them in the current GHAction directory:

1. ARM Deployment Template
[Template File](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-linux/azuredeploy.json)

2. ARM Deployment Parameter File
[Parameter File](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-linux/azuredeploy.parameters.json)

  The second file (ARM template parameter file) is used to conjunction with  the deployment template to pass values for variables at deployment time.

### Make changes to the parameter file
At bear mininum the parameter file needs to be update with a username, pass, for the ARM template. Update the parameter file to something like below:



```
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "adminUsername": {
            "value": "testadm"
        },
        "adminPasswordOrKey": {
            "value": "Change2ASuperSecureP@ss"
        },
        "dnsLabelPrefix": {
            "value": "labtest"
        }
    }
}
```



## Commit changes


```
git commit add . 
git commit -m  "include the arm template and arm parameter files"
git push origin
```


The repo should now reflect the new arm template files in Github

## Create Secrets for Github Actions
Next we'll create a Secret in the Github repository. Secrets provide a secure way store/retrieve credentials in your CI/CD workflow. Since we're using a Github hosted workloads this is reasonable solution. 

- In Github, click on the "*Settings*" tab
- Click the "New Secret Button"
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3mh1limoy1nothjdijcm.png)

- Add the output of service principal json we saved earlier
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vshjq8rrjpokouaick3w.png)

- Let's name the secret "service_creds"

## Create Github Action Workflow
- Click on the Github action tab at the top
![Image](https://dev-to-uploads.s3.amazonaws.com/i/ruww1aiz5oh733mc09gn.png)

- Choose "Skip this and setup a workflow yourself"
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/n4vz9c8qglfpk3jse2cw.png)

## Setting up github actions workflow 
Workflow actions behind the curtain is just a yaml and actually are stored in .\github\workflows
- You can have multiple workflow pipelines ie one for dev, test, prod and deploy to different resource groups or subscriptions. *But* In this example we just have one which will build deploy a linux vm.

Modify the workflow file to look like this


```
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  push:
    branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2

    - name: Azure Login
      uses: Azure/login@v1.1
      with:
        # Paste output of `az ad sp create-for-rbac` as value of secret variable: AZURE_CREDENTIALS
        creds: ${{ secrets.SERVICE_CREDS }}

    # Runs a set of commands using the runners shell
    - name: Deploy ARM Template
      run: |
        az group deployment create --template-file ./azuredeploy.json --template-parameter-file ./azuredeploy.parameters.json --resource-group lab_resourcegroup
```



## Structure of the YAML
This will look very similar if you've Azure Pipelines. At the top part the yaml the name of pipeline the name of the job specified &amp;lt;b&amp;gt;CI&amp;lt;/b&amp;gt;

### Event Triggers
The "on" descriptor specifies the conditions that trigger a deployment. In this case its when ever a push occurs to master branch in github. Triggers are extremely customization. My triggers could be specific file or folder or specific wildcard.

### Jobs/Runners/Steps
A job is series of steps the Workflow does. In this Workflow yaml jobs are running on shared pool of "runners"  virtual machines that Github graciously provides and are wiped after the workflow completion. There many flavors linux, windows, etc. you can choose (for this I'm using the ubuntu-latest). They also come preconfigured with binaries such as azcli, terraform, git.

Jobs have steps. Here we have a step to authenticate to azure. I'm using azurelogin from the marketplace instead of "az login." Why? Well it offers support azcli/and powershell. The cred variable is configured to read repo secret we set up earlier. 

Lastly, the next step is deployment command it self deploying to resource group lab_resourcegroup that was set up in the pre-work

## Build Outcome
Once you committed you workflow you should see the results of your deployment in actions

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xv242bwl3npj0fb3qctd.png)

### Create a Badge
GH Actions allows you easily provide a status to the users on latest build status of the ARM template

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rmfofuin14nh1294u393.png)

# Summary
This was simple, yet rather long example of how to use ARM Templates with Github Actions. I hope you see the potential for using GitHub Workflows as a quick/free solution to automate deployments of your Cloud Infrastructure. 

One Azure Virtual Machine might not really be the prime candidate. However as infrastructure and app dependencies grow the need to consistently and repeatable deploy the exact replica is where Actions show it's true promise.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>azure</category>
      <category>github</category>
      <category>arm</category>
    </item>
  </channel>
</rss>
