Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build Your Azure Infrastructure as Code With .NET Core - Azure Day

Build Your Azure Infrastructure as Code With .NET Core - Azure Day

Hossam Barakat

June 25, 2021

More Decks by Hossam Barakat

Other Decks in Technology


  1. Build Your Azure Infrastructure as Code With .NET Core Hossam

    Barakat Engineering Manager at Willow @hossambarakat_ | www.hossambarakat.net
  2. @hossambarakat_ How to provision cloud resources?

  3. @hossambarakat_ Manual AKA Point and Click

  4. @hossambarakat_ Manual AKA Point and Click

  5. @hossambarakat_ Snowflake Servers

  6. @hossambarakat_ Infrastructure as Code

  7. @hossambarakat_ • Managing and provisioning cloud resources using code. Infrastructure

    as Code
  8. @hossambarakat_ Imperative: CLI commands and scripts

  9. @hossambarakat_ Idempotency and error handling

  10. @hossambarakat_ Declarative Infrastructure as Code

  11. @hossambarakat_ Tool Declarative Infrastructure as Code Desired State Actual Resources

  12. @hossambarakat_ • Azure Resource Manager • Terraform • Bicep •

    AWS CloudFormation • Google Deployment Manager • … Declarative Infrastructure as Code tools
  13. @hossambarakat_ • JSON, YAML, domain specific languages (DSLs),… Infrastructure as

    Code tools
  14. @hossambarakat_

  15. @hossambarakat_ Enter Pulumi

  16. @hossambarakat_ • Pulumi is an open source infrastructure as code

    tool the lets you use real languages – C#, TypeScript, Go,… – to provision and manage cloud resources. What is Pulumi?
  17. @hossambarakat_ • Control flow with loops and if conditions •

    Abstraction with functions, classes, packages,… • Code sharing with package management (Nuget, npm,…) • Authoring with favourite IDEs, refactoring, code completion, static type checking • Testing with existing frameworks and tools Benefits
  18. @hossambarakat_

  19. @hossambarakat_ Pulumi Fundamentals

  20. @hossambarakat_ Projects & Stacks web-app (Pulumi.yaml) Project $ pulumi new

    Stacks $ pulumi stack init stackName Pulumi.<stack-name>.yaml Pulumi.yaml
  21. @hossambarakat_ Configurations $ pulumi config set dbPassword S3cr37 config: serverless-app:dbPassword:

    S3cr37 Pulumi.<stack-name>.yaml var config = new Pulumi.Config(); var password = config.Require("dbPassword"); Pulumi.cs
  22. @hossambarakat_ Application architecture on Azure

  23. @hossambarakat_

  24. @hossambarakat_ But that would be imperative, right?

  25. @hossambarakat_ How Pulumi Works State CLI and Engine AWS Azure

    Kubernetes Providers Code Plan Apply new Resource()
  26. @hossambarakat_ Continuous Deployment Infrastructure as Code Manual Review State

  27. @hossambarakat_ GitHub Integration

  28. @hossambarakat_ Summary

  29. @hossambarakat_

  30. @hossambarakat_ • https://github.com/hossambarakat/pulumi-demos • http://pulumi.com/docs • https://github.com/pulumi/examples Resources

  31. @hossambarakat_ Questions?

  32. Thanks Hossam Barakat @hossambarakat_ www.hossambarakat.net