This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Add steps that build, run tests, deploy, and more: | |
| # https://aka.ms/yaml | |
| name: Build-$(Build.BuildId) | |
| trigger: none | |
| pr: [dev] | |
| pool: | |
| vmImage: 'ubuntu-latest' | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | locals { | |
| tags = merge(var.tags, { "workspace" = "${terraform.workspace}" }) # add terraform workspace tag to any additional tags given as input | |
| } | |
| resource "azurerm_resource_group" "rg" { | |
| count = var.create_resource_group ? 1 : 0 # conditional creation | |
| name = "${terraform.workspace}-${var.resource_group_name}" | |
| location = var.resource_group_location | |
| tags = local.tags | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | while getopts :i:v:p opt; do | |
| case $opt in | |
| i) IMAGE=$OPTARG | |
| ;; | |
| v) VERSION=$OPTARG | |
| ;; | |
| \?) echo "Unknown option: -$OPTARG" >&2 | |
| exit 1 | |
| ;; | |
| esac | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| # | |
| # Maintainer: Omer Barel ([email protected]) | |
| ###################################################################################################################################################################### | |
| # Examples: | |
| # | |
| # | |
| # Run with minimum values (Note that the defaults should pre-exist in your shell environment: TFM_STORAGE_NAME, TFM_STORAGE_CONTAINER, TFM_STORAGE_ACCESS_KEY) | |
| # TerraformInitAzureBackend.sh -f "terraform.tfstate" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | provide "azurerm" {} | |
| ## Declare Variables | |
| variable "resource_group_name" { | |
| default = "my-resource-group" | |
| } | |
| variable "location" { | |
| default = "West Europe" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | resource "random_string" "password" { | |
| length = 14 | |
| min_upper = 2 | |
| min_lower = 2 | |
| min_numeric = 2 | |
| min_special = 2 | |
| } | |
| resource "azurerm_key_vault_secret" "secret" { | |
| name = "${var.secret_name}" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Variables | |
| variable "ad_tenant_id" {} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $ vi .mytfvars | |
| # TF Azure configuration | |
| export TF_VAR_ad_tenant_id=11111111-1111-1111-1111-111111111111 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | az keyvault secret set --name ARM-SUBSCRIPTION-ID --vault-name myVault --value ##ARM_SUBSCRIPTION_ID## | |
| az keyvault secret set --name ARM-CLIENT-ID --vault-name myVault --value ##ARM_CLIENT_ID## | |
| az keyvault secret set --name ARM-CLIENT-SECRET --vault-name myVault --value ##ARM_CLIENT_SECRET## | |
| az keyvault secret set --name ARM-TENANT-ID --vault-name myVault --value ##ARM_TENANT_ID## | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | provider "azurerm" { | |
| subscription_id = "xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx" | |
| client_id ="xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx" | |
| client_secret ="xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx" | |
| tenant_id ="xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx" | |
| } | 
NewerOlder
        