Skip to content

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

@vn143

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions