Skip to content

ResourceGroup - Not found error while running Azure CLI cmd as Shell Script #110

Description

@vn143

Hi,

Getting below error while executing azure cli cmd using shell script function. I tried changing the single/double quotes, but still no luck. If anyone tried on this, please help me to correct the same.

#!/bin/bash
create_subnet(){
    subent_address_prefixes= "$1"
    subnet_name='$2'
    rg_name= '$3'
    vnet_name= '$4'

    az network vnet subnet create --address-prefixes "$1"  --name '$2' --resource-group '$3' --vnet-name '$4'
}

# To create the resource group
az group create --name 'venkyRG' --location 'eastus'

# To create vnet and address space
az network vnet create --name 'venkyVNET' --resource-group 'venkyRG' --address-prefixes "172.32.0.0/16"

# To create ApplicationGatewaySubnet 
create_subnet '172.32.0.0/24' 'ApplicationGatewaySubnet' 'venkyRG' 'venkyVNET'

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions