azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Unable to deploy basic Bastion SKU

Open ld0614 opened this issue 1 year ago • 5 comments

Description

When running the command New-AzBastion -ResourceGroupName $VNetRG -Name "$VNetName-bastion" -PublicIpAddressRgName $ResourceGroupName -PublicIpAddressName $BastionPIPName -VirtualNetworkRgName $VNetRG -VirtualNetworkName $VNetName -Sku "Basic"

I get the error

New-AzBastion: Bastion scalable host is available on Standard SKU

As you can see from the above the -Sku is set to Basic and I am not explicitly setting the -ScaleUnit parameter which suggests that a default value is being included somewhere or validation can't handle $null correctly.

I've tried setting -ScaleUnit to 0 and $null without any change in the error message

Happy to provide more info/logs if relevant

Issue script & Debug output

Most data removed to avoid sensitive information, from what I was reading it just covered auth and successfully finding pre-req resources

DEBUG: 15:23:43 - NewAzBastionCommand begin processing with ParameterSet 'ByPublicIpAddressRgNameByPublicIpAddressNameByVirtualNetworkRGNameByVirtualNetworkName'.

Body:
{
  "error": {
    "code": "ResourceNotFound",
    "message": "The Resource 'Microsoft.Network/bastionHosts/bastion' under resource group 'ResourceGroup' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"
  }
}

DEBUG: 15:23:54 - [ConfigManager] Got nothing from [EnableErrorRecordsPersistence], Module = [], Cmdlet = []. Returning default value [False].
New-AzBastion: Bastion scalable host is available on Standard SKU
DEBUG: 15:23:54 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 15:23:54 - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 15:23:54 - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent:  Module: Az.Network:7.6.0; CommandName: New-AzBastion; PSVersion: 7.4.2; IsSuccess: False; Duration: 00:00:03.9684244; SanitizeDuration: 00:00:00; Exception: Bastion scalable host is available on Standard SKU;
DEBUG: 15:23:54 - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 15:23:54 - NewAzBastionCommand end processing.

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                
Script     8.0.0                 Az.Compute                       
Script     7.6.0                 Az.Network                          
Script     7.1.0                 Az.Resources                        
Script     7.0.0                 Az.Storage

Error output

Message        : Bastion scalable host is available on Standard SKU
StackTrace     :    at Microsoft.Azure.Commands.Network.Bastion.BastionBaseCmdlet.ValidateScaleUnits(PSBastion bastion, Nullable`1 scaleUnits)
                    at Microsoft.Azure.Commands.Network.Bastion.NewAzBastionCommand.CreateBastion()
                    at Microsoft.Azure.Commands.Network.Bastion.NewAzBastionCommand.<Execute>b__76_0()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ConfirmAction(String processMessage, String target, Action action)  
                    at Microsoft.Azure.Commands.Network.Bastion.NewAzBastionCommand.Execute()
                    at Microsoft.Azure.Commands.Network.NetworkBaseCmdlet.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : System.ArgumentException
InvocationInfo : {New-AzBastion}
Line           :         New-AzBastion -ResourceGroupName $VNetRG -Name "$VNetName-bastion" -PublicIpAddressRgName $ResourceGroupName
                 -PublicIpAddressName $BastionPIPName -VirtualNetworkRgName $VNetRG -VirtualNetworkName $VNetName -Sku "Basic" -Debug
Position       : At line:1 char:9
                 +         New-AzBastion -ResourceGroupName $VNetRG -Name "$VNetName-bas …
                 +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 108

ld0614 avatar Jun 04 '24 14:06 ld0614

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

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

@ld0614 I ran into this same issue, and found your GH issue here. If you're still experiencing this, I was able to work around it by just not providing the -Sku parameter. Its value is Basic by default, if not provided, according to this learn article.

Obviously not proposing it as a permanent solution, but seems to have worked for me!

tbisque avatar Jun 17 '24 19:06 tbisque

Thanks @tbisque it's most appreciated!

ld0614 avatar Jun 17 '24 19:06 ld0614

@ld0614, I spoke too soon. Omitting the -Sku parameter created a standard tier bastion (in Azure US Government at least) :(

tbisque avatar Jun 17 '24 19:06 tbisque

I had the same problem and fixed by upgrading the Az.Network module to 7.11.0

ciscogeek avatar Jan 08 '25 01:01 ciscogeek

Hello @ld0614 , thank you for reporting this issue. It has been fixed in Az.Network v7.8.0. Alternatively, if you cannot upgrade the module then you can get around it by specifying ScaleUnit value as "2" with Basic SKU.

abhi7860 avatar Feb 05 '25 17:02 abhi7860