About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
powershell_heavy
⚠️
windows_tools
⚠️
windows_first
Summary:
The documentation demonstrates a moderate Windows bias. PowerShell is presented as a primary automation method alongside the Azure CLI, and the prerequisites section provides detailed instructions for installing and using Azure PowerShell, which is a Windows-centric tool. The documentation refers to 'PowerShell' without clarifying cross-platform support, and the CLI examples use the Azure CLI, which is cross-platform, but there is no mention of Bash or Linux-specific shell usage. The order of presentation is mostly Portal, PowerShell, then CLI, which subtly prioritizes Windows tooling. There are no explicit Linux/Bash examples or references to Linux-native tools.
Recommendations:
- Clarify that Azure PowerShell is available cross-platform, but also provide Bash shell examples where appropriate.
- Add explicit Bash/Linux shell examples for CLI commands, including sample shell scripts for automation.
- In the prerequisites, mention that Azure CLI and Azure PowerShell are both available on Linux, macOS, and Windows, and provide installation links for all platforms.
- Consider alternating the order of PowerShell and CLI examples, or explicitly stating that both are cross-platform.
- Where possible, provide guidance for Linux users (e.g., using Bash variables, scripting, or integrating with Linux-native automation tools).
Create pull request
Flagged Code Snippets
## Place the load balancer information into a variable for later use. ##
$slb = @{
ResourceGroupName = 'myResourceGroup'
Name = 'myLoadBalancer'
}
$lb = Get-AzLoadBalancer @slb
## Create the single virtual machine inbound NAT rule. ##
$rule = @{
Name = 'myInboundNATrule'
Protocol = 'Tcp'
FrontendIpConfiguration = $lb.FrontendIpConfigurations[0]
FrontendPort = '500'
BackendPort = '443'
}
$lb | Add-AzLoadBalancerInboundNatRuleConfig @rule
$lb | Set-AzLoadBalancer
## Add the inbound NAT rule to a virtual machine
$NatRule = @{
Name = 'MyInboundNATrule'
LoadBalancer = $lb
}
$NatRuleConfig = Get-AzLoadBalancerInboundNatRuleConfig @NatRule
$NetworkInterface = @{
ResourceGroupName = 'myResourceGroup'
Name = 'MyNIC'
}
$NIC = Get-AzNetworkInterface @NetworkInterface
$IPconfig = @{
Name = 'Ipconfig'
LoadBalancerInboundNatRule = $NatRuleConfig
}
$NIC | Set-AzNetworkInterfaceIpConfig @IPconfig
$NIC | Set-AzNetworkInterface
## Place the load balancer information into a variable for later use. ##
$slb = @{
ResourceGroupName = 'myResourceGroup'
Name = 'myLoadBalancer'
}
$lb = Get-AzLoadBalancer @slb
## Create the multiple virtual machines inbound NAT rule. ##
$rule = @{
Name = 'myInboundNATrule'
Protocol = 'Tcp'
BackendPort = '443'
FrontendIpConfiguration = $lb.FrontendIpConfigurations[0]
FrontendPortRangeStart = '500'
FrontendPortRangeEnd = '1000'
BackendAddressPool = $lb.BackendAddressPools[0]
}
$lb | Add-AzLoadBalancerInboundNatRuleConfig @rule
$lb | Set-AzLoadBalancer
## Place the load balancer information into a variable for later use. ##
$slb = @{
ResourceGroupName = 'myResourceGroup'
Name = 'myLoadBalancer'
}
$lb = Get-AzLoadBalancer @slb
## Set the new port allocation
$rule = @{
Name = 'myInboundNATrule'
Protocol = 'Tcp'
BackendPort = '443'
FrontendIpConfiguration = $lb.FrontendIpConfigurations[0]
FrontendPortRangeStart = '500'
FrontendPortRangeEnd = '1500'
BackendAddressPool = $lb.BackendAddressPools[0]
}
$lb | Set-AzLoadBalancerInboundNatRuleConfig @rule
## Place the load balancer information into a variable for later use. ##
$slb = @{
ResourceGroupName = 'myResourceGroup'
Name = 'myLoadBalancer'
}
$lb = Get-AzLoadBalancer @slb
## Remove the inbound NAT rule
$lb | Remove-AzLoadBalancerInboundNatRuleConfig -Name 'myInboundNATrule'
$lb | Set-AzLoadBalancer