What do you someone breaks something? I post the solution here...

Kubernetes (K8s/K3d) / Terraform / Ansible / Linux / AWS / Docker / Bash / Python / ELK / CI/CD / Java / Traefik / Nginx / CentOs / Ubuntu


Write a Function to Create A Resource Group in Azure




Write a Function to Create A Resource Group in Azure(Part1)


          Resource Group:  
                    
                   The Infrastructure for your application typically consist:

  1. Virtual Machine
  2. Storage
  3. Virtual Network
  4. Web app
  5. Database etc 

    A resource is a manageable item as listed above and resource group is a container that holds related
    resources 



$RG="Osgroup"

$Location="South Central US"

function CreateRG ($Name, $Location){
    # First Check if the RG exists with this name
    Get-AzureRmResourceGroup -Name $Name -ev notpresent -ea 0
    
    if ($notpresent){
        New-AzureRmResourceGroup -Name $Name -Location $Location
    }
    else{
    
        Write-Host "RESOURCE GROUP $Name Exists !!! Please Specify Another Name"
    }

}


CreateRG($RG,$Location)
Thank you !!! And Have Nice Day!!!

    For Silent Login to Azure Account
 https://osgroup-techies.blogspot.in/2016/12/silent-login-to-azure-account-is-have.html


      



No comments:

Powered by Blogger.