Skip to content

A utility to provide quick feedback on Azure ARM templates.

License

Notifications You must be signed in to change notification settings

chgeuer/ex_microsoft_arm_evaluator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microsoft.ARM.Evaluator

Check the blog article here: blog.geuer-pollmann.de/blog/2019/10/14/locally-evaluating-azure-arm-templates ...

How to install

Clone the code

git clone https://github.com/chgeuer/ex_microsoft_arm_evaluator
cd ex_microsoft_arm_evaluator

Fetch required Elixir packages

mix deps.get

Compile the whole thing

mix compile

On Windows, set this env variable

set iex_with_werl=true

Launch the interactive Elixir shell

iex -S mix

demo time

start https://microsoft.com/devicelogin
alias Microsoft.Azure.TemplateLanguageExpressions.{Resource, Context, DeploymentContext, Evaluator.Resource}

login_cred = DemoUtil.login()

sub = "724467b5-bee4-484b-bf13-d6a5505d2b51"

deploymentContext = %DeploymentContext{ subscriptionId: sub, resourceGroup: "longterm" } |> DeploymentContext.with_device_login(login_cred)

Resource.subscription([], Context.new() |> Context.with_deployment_context(deploymentContext))

"sample_files/1.json" |> DemoUtil.transform(deploymentContext, %{})

"sample_files/automation.json" |> DemoUtil.transform(deploymentContext, %{"adminPassword" => "SuperSecret123.-##"})

Implementation Status

  • All numeric / logical / array&objects / comparison functions
  • Custom function definitions should work
  • The reference() function needs more dummy data for scenarios where the users are not signed-in to their real subscription.
  • The copyIndex() function currently doesn't duplicate nodes in the document.

Other projects in that problem space