Set-AzBastion
Updates the Bastion Resource.
Syntax
Default (Default)
Set-AzBastion
-InputObject <PSBastion>
[-Sku <String>]
[-ScaleUnit <Int32>]
[-EnableKerberos <Boolean>]
[-DisableCopyPaste <Boolean>]
[-EnableTunneling <Boolean>]
[-EnableIpConnect <Boolean>]
[-EnableShareableLink <Boolean>]
[-EnableSessionRecording <Boolean>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-AzBastion cmdlet can be used to update the Sku, Scale Units or Tags of an existing BastionHost resource.
Examples
Example 1
Set-AzBastion -InputObject $bastionObj -Sku "Standard" -ScaleUnit 10 -Force
Name : MyBastion
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/bastionHosts/MyBastion
Etag : W/"000"
Type : Microsoft.Network/bastionHosts
Location : westus2
Tag :
TagsTable :
ResourceGroupName : MyRg
DnsName : bst-00000000-0000-0000-0000-000000000001.test.bastion.azure.com
ResourceGuid :
ProvisioningState : Succeeded
IpConfigurationsText : [
{
"Subnet": {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/virtualNetworks/MyVnet/subnets/AzureBastionSubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/publicIPAddresses/PublicIp1"
},
"ProvisioningState": "Succeeded",
"PrivateIpAllocationMethod": "Dynamic",
"Name": "IpConf",
"Etag": "W/\"000\"",
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/bastionHosts/MyBastion/bastionHostIpConfigurations/IpConf"
}
]
Sku : {
"Name": "Standard"
}
Scale Units : 10
Updates BastionHost resource with Basic Sku and 2 Scale Units to Standard Sku and 10 Scale Units
Example 2
$bastionObj = Get-AzBastion -ResourceGroupName "MyRg" -Name "MyBastion"
$bastionObj
Name : MyBastion
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/bastionHosts/MyBastion
Etag : W/"000"
Type : Microsoft.Network/bastionHosts
Location : westus2
Tag :
TagsTable :
ResourceGroupName : MyRg
DnsName : bst-00000000-0000-0000-0000-000000000001.test.bastion.azure.com
ResourceGuid :
ProvisioningState : Succeeded
IpConfigurationsText : [
{
"Subnet": {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/virtualNetworks/MyVnet/subnets/AzureBastionSubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/publicIPAddresses/PublicIp1"
},
"ProvisioningState": "Succeeded",
"PrivateIpAllocationMethod": "Dynamic",
"Name": "IpConf",
"Etag": "W/\"000\"",
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/bastionHosts/MyBastion/bastionHostIpConfigurations/IpConf"
}
]
Sku : {
"Name": "Basic"
}
Scale Units : 2
$bastionObj.Sku.Name = "Standard"
$bastionObj.ScaleUnit = 50
Set-AzBastion -InputObject $bastionObj -Force
Name : MyBastion
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/bastionHosts/MyBastion
Etag : W/"000"
Type : Microsoft.Network/bastionHosts
Location : westus2
Tag :
TagsTable :
ResourceGroupName : MyRg
DnsName : bst-00000000-0000-0000-0000-000000000001.test.bastion.azure.com
ResourceGuid :
ProvisioningState : Succeeded
IpConfigurationsText : [
{
"Subnet": {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/virtualNetworks/MyVnet/subnets/AzureBastionSubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/publicIPAddresses/PublicIp1"
},
"ProvisioningState": "Succeeded",
"PrivateIpAllocationMethod": "Dynamic",
"Name": "IpConf",
"Etag": "W/\"000\"",
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRg/providers/Microsoft.Network/bastionHosts/MyBastion/bastionHostIpConfigurations/IpConf"
}
]
Sku : {
"Name": "Standard"
}
Scale Units : 50
Updates BastionHost resource with Basic Sku and 2 Scale Units to Standard Sku and 50 Scale Units
Parameters
-AsJob
Run cmdlet in the background
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DisableCopyPaste
Copy and Paste
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-EnableIpConnect
IP Connect
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-EnableKerberos
Kerberos
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-EnableSessionRecording
Session Recording
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-EnableShareableLink
Shareable Link
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-EnableTunneling
Native Client
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Force
Ask for confirmation if you want to overwrite a resource
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
The BastionHost Object
Type: PSBastion
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-ScaleUnit
The Bastion Scale Units
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Sku
The Bastion Sku Tier
Parameter properties
Type: String
Default value: Basic
Accepted values: Basic, Standard, Premium
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Tag
A hashtable which represents resource tags.
Parameter properties
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs