Skip to content

--subnet does not work in VS code/Gitbash #23918

@Candelit

Description

@Candelit

Hi.

There seems to be some kind of general bug somewhere in either VS code, gitbash or the az module.
Wherever resourceid for subnet is used the cli command will fail if it is run in VS code

The documentation states that --subnet is name or resource id...
When it comes to running this in CloudShell, it is correct, but in VS code it fails.
I have now tested with a storage account and a VM and same thing.

This is what happens:
SUBNET_ID=$(az network vnet subnet show --resource-group $VNET_RESOURCE_GROUP --name $SUBNET1 --vnet-name $VNET --query id -o tsv)
az storage account create \

--name $STORAGEACCOUNT_NAME \
--resource-group $SYNAPSE_RESOURCE_GROUP \
--location $REGION \
--sku Standard_LRS \
--kind StorageV2 \
--enable-hierarchical-namespace \
--min-tls-version TLS1_2 \
--subnet $SUBNET_ID

←[91mincorrect usage: [--subnet ID | --subnet NAME --vnet-name NAME]←[0m

And as I said, the same always works fine i CloudShell
(It is not the ID get that is the problem, that works. It makes no difference if I type or paste it in as a string)

Thanks
// Thomas Odell Balkeståhl


Dokumentinformation

Redigera inte det här avsnittet. Det krävs för docs.microsoft.com ➟ länkning till GitHub-problem.

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamNetworkaz network vnet/lb/nic/dns/etc...OKR CandidateThis label is used to track how many GitHub issues we have resolved for OKR purpose.Storageaz storagecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions