Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3.01k forks source link

az network bastion create fails #26619

Open PLovertime opened 1 year ago

PLovertime commented 1 year ago

Describe the bug

/bin/bash

RG='azcy001' source conf/config.cfg echo "Creating Public IP in resource group: $RG " az network public-ip create --resource-group $RG --name $RG-bastion-ip --sku Standard --location westeurope -o table echo "" echo -e "Creating Bastion in $RG with " az network bastion create --name $RG-bastion --public-ip-address $RG-bastion-ip --resource-group $RG --vnet-name per001-vn001 --location westeurope -o table echo ""

Fails with the following issues /providers/Microsoft.Network/virtualNetworks/PER001-VN001

For som reason az network bastion, creates the request in all CAPS for the VNet name and the resource group.

Related command

RG='azcy001' az network bastion create --name $RG-bastion --public-ip-address $RG-bastion-ip --resource-group $RG --vnet-name per001-vn001 --location westeurope -o table

Errors

(InvalidResourceReference) Resource /subscriptions/removed/resourceGroups/AZCY001/providers/Microsoft.Network/virtualNetworks/PER001-VN001 referenced by resource /subscriptions/removed/resourceGroups/azcy001/providers/Microsoft.Network/bastionHosts/azcy001-bastion was not found. Please make sure that the referenced resource exists, and that both resources are in the same region. Code: InvalidResourceReference Message: Resource /subscriptions/removed/resourceGroups/AZCY001/providers/Microsoft.Network/virtualNetworks/PER001-VN001 referenced by resource /subscriptions/removed/resourceGroups/azcy001/providers/Microsoft.Network/bastionHosts/azcy001-bastion was not found. Please make sure that the referenced resource exists, and that both resources are in the same region. Exception Details: (NotFound) Resource /subscriptions/removed/resourceGroups/AZCY001/providers/Microsoft.Network/virtualNetworks/PER001-VN001 not found. Code: NotFound Message: Resource /subscriptions/removed/resourceGroups/AZCY001/providers/Microsoft.Network/virtualNetworks/PER001-VN001 not found.

Issue script & Debug output

RG='azcy001' az network bastion create --name $RG-bastion --public-ip-address $RG-bastion-ip --resource-group $RG --vnet-name per001-vn001 --location westeurope -o table

Expected behavior

That resource group and vnet does not get all caps when running the command

Environment Summary

azure-cli 2.49.0

core 2.49.0 telemetry 1.0.8

Extensions: bastion 0.2.4

Dependencies: msal 1.20.0 azure-mgmt-resource 22.0.0

Additional context

No response

yonzhan commented 1 year ago

Thank you for opening this issue, we will look into it.

ghost commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub.

Issue Details
### Describe the bug #/bin/bash RG='**azcy001**' source conf/config.cfg echo "Creating Public IP in resource group: $RG " az network public-ip create --resource-group $RG --name $RG-bastion-ip --sku Standard --location westeurope -o table echo "" echo -e "Creating Bastion in $RG with " az network bastion create --name $RG-bastion --public-ip-address $RG-bastion-ip --resource-group $RG --vnet-name **per001-vn001** --location westeurope -o table echo "" Fails with the following issues /providers/Microsoft.Network/virtualNetworks/PER001-VN001 For som reason az network bastion, creates the request in all CAPS for the VNet name and the resource group. ### Related command RG='azcy001' az network bastion create --name $RG-bastion --public-ip-address $RG-bastion-ip --resource-group $RG --vnet-name per001-vn001 --location westeurope -o table ### Errors (InvalidResourceReference) Resource /subscriptions/removed/resourceGroups/AZCY001/providers/Microsoft.Network/virtualNetworks/PER001-VN001 referenced by resource /subscriptions/removed/resourceGroups/azcy001/providers/Microsoft.Network/bastionHosts/azcy001-bastion was not found. Please make sure that the referenced resource exists, and that both resources are in the same region. Code: InvalidResourceReference Message: Resource /subscriptions/removed/resourceGroups/AZCY001/providers/Microsoft.Network/virtualNetworks/PER001-VN001 referenced by resource /subscriptions/removed/resourceGroups/azcy001/providers/Microsoft.Network/bastionHosts/azcy001-bastion was not found. Please make sure that the referenced resource exists, and that both resources are in the same region. Exception Details: (NotFound) Resource /subscriptions/removed/resourceGroups/AZCY001/providers/Microsoft.Network/virtualNetworks/PER001-VN001 not found. Code: NotFound Message: Resource /subscriptions/removed/resourceGroups/**AZCY001**/providers/Microsoft.Network/virtualNetworks**/PER001-VN001 n**ot found. ### Issue script & Debug output RG='azcy001' az network bastion create --name $RG-bastion --public-ip-address $RG-bastion-ip --resource-group $RG --vnet-name per001-vn001 --location westeurope -o table ### Expected behavior That resource group and vnet does not get all caps when running the command ### Environment Summary azure-cli 2.49.0 core 2.49.0 telemetry 1.0.8 Extensions: bastion 0.2.4 Dependencies: msal 1.20.0 azure-mgmt-resource 22.0.0 ### Additional context _No response_
Author: PLovertime
Assignees: -
Labels: `bug`, `Network`, `Service Attention`, `customer-reported`, `Network - Bastion`, `Auto-Assign`
Milestone: Backlog
navba-MSFT commented 1 year ago

Adding Service team to look into this.