Skip to content

az network bastion create fails #26619

@PLovertime

Description

@PLovertime

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botNetworkaz network vnet/lb/nic/dns/etc...Network - BastionService AttentionThis issue is responsible by Azure service team.act-quality-productivity-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionThis issue needs attention from Azure service team or SDK team

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions