AZ-700 tasks with the Azure CLI and PowerShell side by side for each domain, copied from the topic pages.
Every command here comes from a CLI or PowerShell table on one of the AZ-700 topic pages. A - means the topic page gives no command for that tool. Placeholders such as <rg> are yours to fill in.
| Task | Azure CLI | PowerShell |
|---|
| Create a virtual network | az network vnet create --resource-group myResourceGroup --name myVNet | New-AzVirtualNetwork @net |
| Change the address space | az network vnet update --resource-group myResourceGroup --name myVNet --address-prefixes 10.1.0.0/16 | Set-AzVirtualNetwork |
| Add a subnet | az network vnet subnet create --name <subnetName> --resource-group <resourceGroupName> --vnet-name <virtualNetworkName> | Add-AzVirtualNetworkSubnetConfig |
| Delegate a subnet to a service | az network vnet subnet update --resource-group test-rg --name subnet-1 --vnet-name vnet-1 --delegations Microsoft.Sql/managedInstances | Add-AzDelegation |
| Check a subnet delegation | az network vnet subnet show --resource-group test-rg --name subnet-1 --vnet-name vnet-1 --query delegations | Get-AzDelegation |
| Create a zone-redundant Standard public IP | az network public-ip create --resource-group QuickStartCreateIP-rg --name myStandardPublicIP --version IPv4 --sku Standard --zone 1 2 3 | New-AzPublicIpAddress |
| Public IP with Internet routing preference | az network public-ip create --resource-group QuickStartCreateIP-rg --name myStandardPublicIP-RP --version IPv4 --ip-tags 'RoutingPreference=Internet' --sku Standard --zone 1 2 3 | - |
| Global tier public IP | az network public-ip create --resource-group QuickStartCreateIP-rg --name myStandardPublicIP-Global --version IPv4 --tier global --sku Standard | - |
| Create a public IP prefix | az network public-ip prefix create --length 28 --name myPublicIpPrefix --resource-group QuickStartCreateIPPrefix-rg --sku standard --location westus2 --version IPv4 --zone 1 2 3 | New-AzPublicIpPrefix |
| Create a static public IP from a prefix | az network public-ip create --name myPublicIP --resource-group QuickStartCreateIPPrefix-rg --allocation-method Static --public-ip-prefix myPublicIpPrefix --sku Standard --version IPv4 | - |
| Delete a public IP prefix | az network public-ip prefix delete --name myPublicIpPrefix --resource-group QuickStartCreateIPPrefix-rg | Remove-AzPublicIpPrefix |
| Provision a custom IP prefix (unified, zone-redundant) | az network custom-ip prefix create --name myCustomIpPrefix --resource-group myResourceGroup --location westus2 --cidr '1.2.3.0/24' --zone 1 2 3 --authorization-message $byoipauth --signed-message $byoipauthsigned | - |
| Commission a custom IP prefix | az network custom-ip prefix update --name myCustomIpPrefix --resource-group myResourceGroup --state commission | Update-AzCustomIpPrefix |
| Decommission a custom IP prefix | az network custom-ip prefix update ... --state decommission | Update-AzCustomIpPrefix ... -Decommission |
| Set a static private IP on a NIC | az network nic ip-config update --resource-group myResourceGroup --nic-name myNic --name myIpConfig --private-ip-address 10.0.0.10 | Set-AzNetworkInterfaceIpConfig -Name myIpConfig -NetworkInterface $nic -Subnet $subnet -PrivateIpAddress 10.0.0.10 |
| Add an IP configuration to a NIC | az network nic ip-config create --resource-group myResourceGroup --name myIpConfig --nic-name myNic | - |
| Task | Azure CLI | PowerShell |
|---|
| Change the DNS servers of a VNet | az network vnet update --resource-group myResourceGroup --name myVNet --dns-servers 10.0.0.10 | $virtualNetwork.DhcpOptions.DnsServers.Add("10.0.0.10") then Set-AzVirtualNetwork -VirtualNetwork $virtualNetwork |
| Create a public DNS zone | az network dns zone create --resource-group MyResourceGroup --name contoso.com | New-AzDnsZone -Name contoso.com -ResourceGroupName MyDNSResourceGroup |
| Show a zone (and its name servers) | az network dns zone show --resource-group myresourcegroup --name contoso.com | - |
| List public DNS zones | az network dns zone list --resource-group MyResourceGroup | - |
| Add an A record | az network dns record-set a add-record -g MyResourceGroup -z contoso.xyz -n www -a 10.10.10.10 | - |
| Create a private DNS zone | az network private-dns zone create --resource-group MyAzureResourceGroup --name private.contoso.com | New-AzPrivateDnsZone -Name private.contoso.com -ResourceGroupName MyAzureResourceGroup |
| Link a VNet to a private zone with autoregistration | az network private-dns link vnet create --resource-group MyAzureResourceGroup --name MyDNSLink --zone-name private.contoso.com --virtual-network myAzureVNet --registration-enabled true | New-AzPrivateDnsVirtualNetworkLink -ZoneName private.contoso.com -ResourceGroupName MyAzureResourceGroup -Name "mylink" -VirtualNetworkId $vnet.id -EnableRegistration |
| Link a VNet for resolution only | az network private-dns link vnet create ... --registration-enabled false | New-AzPrivateDnsVirtualNetworkLink -ZoneName private.contoso.com ... (without -EnableRegistration) |
| List private DNS zones | az network private-dns zone list --resource-group MyAzureResourceGroup | - |
| Create a DNS Private Resolver | - | New-AzDnsResolver -Name mydnsresolver -ResourceGroupName myresourcegroup -Location westcentralus -VirtualNetworkId "/subscriptions/<your subs id>/resourceGroups/myresourcegroup/providers/Microsoft.Network/virtualNetworks/myvnet" |
| Create the inbound endpoint | - | New-AzDnsResolverInboundEndpoint -DnsResolverName mydnsresolver -Name myinboundendpoint -ResourceGroupName myresourcegroup -Location westcentralus -IpConfiguration $ipconfig |
| Create the outbound endpoint | - | New-AzDnsResolverOutboundEndpoint -DnsResolverName mydnsresolver -Name myoutboundendpoint -ResourceGroupName myresourcegroup -Location westcentralus -SubnetId /subscriptions/<your sub id>/resourceGroups/myresourcegroup/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/snet-outbound |
| Create a forwarding ruleset | - | New-AzDnsForwardingRuleset -Name myruleset -ResourceGroupName myresourcegroup -DnsResolverOutboundEndpoint $outboundendpoint -Location westcentralus |
| Task | Azure CLI | PowerShell |
|---|
| Create a VNet peering | az network vnet peering create --name vnet-1-to-vnet-2 --vnet-name vnet-1 --remote-vnet vnet-2 --resource-group test-rg --allow-vnet-access --allow-forwarded-traffic | Add-AzVirtualNetworkPeering -Name SpokeRMtoHubRM -VirtualNetwork $spokermvnet -RemoteVirtualNetworkId $hubrmvnet.Id -UseRemoteGateways |
| Enable gateway transit on the hub side | - | Add-AzVirtualNetworkPeering -Name HubRMToSpokeRM -VirtualNetwork $hubrmvnet -RemoteVirtualNetworkId $spokermvnet.Id -AllowGatewayTransit |
| List peerings of a VNet | az network vnet peering list --resource-group test-rg --vnet-name vnet-1 --out table | Get-AzVirtualNetworkPeering @peer |
| Create a route table | az network route-table create --resource-group test-rg --name route-table-public | New-AzRouteTable @routeTableParams |
| Add a UDR to a virtual appliance | az network route-table route create --name to-private-subnet --resource-group test-rg --route-table-name route-table-public --address-prefix 10.0.2.0/24 --next-hop-type VirtualAppliance --next-hop-ip-address 10.0.3.4 | Add-AzRouteConfig |
| UDR that uses a service tag as the prefix | az network route-table route create --resource-group MyResourceGroup --route-table-name MyRouteTable --name StorageRoute --address-prefix Storage --next-hop-type VirtualAppliance --next-hop-ip-address 10.0.100.4 | New-AzRouteConfig @param |
| Associate a route table with a subnet | az network vnet subnet update --vnet-name vnet-1 --name subnet-1 --resource-group test-rg --route-table route-table-public | Set-AzVirtualNetworkSubnetConfig |
| Show effective routes of a NIC | az network nic show-effective-route-table --name vm-1445 --resource-group test-rg | Get-AzEffectiveRouteTable @Params | Format-Table |
| Create a Route Server | az network routeserver create --name 'myRouteServer' --resource-group 'myResourceGroup' --hosted-subnet $subnetId --public-ip-address 'RouteServerIP' | New-AzRouteServer -RouteServerName 'myRouteServer' -ResourceGroupName 'myResourceGroup' -Location 'EastUS' -HostedSubnet $subnetId -PublicIP $publicIp -VirtualRouterAutoScaleConfiguration $autoscale |
| Add a BGP peer (NVA) to Route Server | az network routeserver peering create --name 'myNVA' --peer-ip '10.0.0.4' --peer-asn '65001' --routeserver 'myRouteServer' --resource-group 'myResourceGroup' | Add-AzRouteServerPeer -ResourceGroupName 'myResourceGroup' -RouteServerName 'myRouteServer' -PeerName 'myNVA' -PeerAsn '65001' -PeerIp '10.0.0.4' |
| Get Route Server IPs and ASN | az network routeserver show --resource-group 'myResourceGroup' --name 'myRouteServer' | Get-AzRouteServer -ResourceGroupName 'myResourceGroup' -RouteServerName 'myRouteServer' |
| Create a NAT gateway | az network nat gateway create --resource-group test-rg --name nat-gateway --public-ip-addresses public-ip-nat --idle-timeout 10 | $natGateway = New-AzNatGateway @nat |
| Associate a NAT gateway with a subnet | az network vnet subnet update --resource-group test-rg --vnet-name vnet-1 --name subnet-1 --nat-gateway nat-gateway | Set-AzVirtualNetworkSubnetConfig @subnet |
| Task | Azure CLI | PowerShell |
|---|
| Enable Network Watcher in a region | az network watcher configure --resource-group 'NetworkWatcherRG' --locations 'eastus' --enabled | New-AzNetworkWatcher -Name 'NetworkWatcher_eastus' -ResourceGroupName 'NetworkWatcherRG' -Location 'eastus' |
| Start a packet capture | az network watcher packet-capture create --name 'myVM_1' --resource-group 'myResourceGroup' --vm 'myVM' --storage-account 'mystorageaccount' | New-AzNetworkWatcherPacketCapture -Location 'eastus' -PacketCaptureName 'myVM_1' -TargetVirtualMachineId $vm.Id -StorageAccountId $storageAccount.Id |
| Check the status of a packet capture | az network watcher packet-capture show-status --location 'eastus' --name 'myVM_1' | - |
| Stop a packet capture | az network watcher packet-capture stop --location 'eastus' --name 'myVM_1' | - |
| Create a VNet flow log with traffic analytics | az network watcher flow-log create --location 'eastus' --name 'myVNetFlowLog' --resource-group 'myResourceGroup' --vnet 'myVNet' --storage-account 'myStorageAccount' --traffic-analytics true --workspace 'myWorkspace' --interval 10 | New-AzNetworkWatcherFlowLog -Enabled $true -Name 'myVNetFlowLog' -NetworkWatcherName 'NetworkWatcher_eastus' -ResourceGroupName 'NetworkWatcherRG' -StorageId $storageAccount.Id -TargetResourceId $vnet.Id -FormatVersion 2 -EnableTrafficAnalytics -TrafficAnalyticsWorkspaceId $workspace.ResourceId |
| Create a VNet flow log (no traffic analytics) | az network watcher flow-log create --location 'eastus' --resource-group 'myResourceGroup' --name 'myVNetFlowLog' --vnet 'myVNet' --storage-account 'myStorageAccount' | New-AzNetworkWatcherFlowLog -Enabled $true -Name 'myVNetFlowLog' -NetworkWatcherName 'NetworkWatcher_eastus' -ResourceGroupName 'NetworkWatcherRG' -StorageId $storageAccount.Id -TargetResourceId $vnet.Id -FormatVersion 2 |
| Task | Azure CLI | PowerShell |
|---|
| Create a local network gateway | az network local-gateway create --gateway-ip-address [IP address of your on-premises VPN device] --name Site1 --resource-group TestRG1 --local-address-prefixes 10.3.0.0/16 10.0.0.0/24 | New-AzLocalNetworkGateway -Name LocalSite -ResourceGroupName testrg -Location 'West US' -GatewayIpAddress '23.99.221.164' -AddressPrefix '10.5.51.0/24' |
| Create a site-to-site connection | az network vpn-connection create --name VNet1toSite1 --resource-group TestRG1 --vnet-gateway1 VNet1GW -l eastus --shared-key abc123 --local-gateway2 Site1 | New-AzVirtualNetworkGatewayConnection -Name VNet1toSite1 -ResourceGroupName TestRG1 -Location 'East US' -VirtualNetworkGateway1 $gateway1 -LocalNetworkGateway2 $local -ConnectionType IPsec -SharedKey 'abc123' |
| Create an active-active, zone-redundant VPN gateway | az network vnet-gateway create --name VNet1GW --public-ip-addresses VNet1GWpip1 VNet1GWpip2 --resource-group TestRG1 --vnet VNet1 --gateway-type Vpn --vpn-type RouteBased --sku VpnGw2AZ --vpn-gateway-generation Generation2 --no-wait | New-AzVirtualNetworkGateway -Name VNet1GW -ResourceGroupName TestRG1 -Location "East US" -IpConfigurations $gwipconfig1,$gwipconfig2 -GatewayType "Vpn" -VpnType RouteBased -GatewaySku VpnGw2AZ -VpnGatewayGeneration Generation2 -EnableActiveActiveFeature -Debug |
| Request a zone-redundant Standard public IP for the gateway | az network public-ip create --name VNet1GWpip1 --resource-group TestRG1 --allocation-method Static --sku Standard --version IPv4 --zone 1 2 3 | New-AzPublicIpAddress -Name "VNet1GWpip1" -ResourceGroupName "TestRG1" -Location "EastUS" -AllocationMethod Static -Sku Standard -Zone 1,2,3 |
| Reset a VPN gateway | az network vnet-gateway reset -n VNet5GW -g TestRG5 | Reset-AzVirtualNetworkGateway -VirtualNetworkGateway $gw |
| Check the connection status | az network vpn-connection show --resource-group "<resource-group>" --name "<connection-name>" --query connectionStatus --output tsv | - |
| View the connection shared key | az network vpn-connection shared-key show --connection-name VNet1toSite2 --resource-group TestRG1 | Get-AzVirtualNetworkGatewayConnectionSharedKey -Name <Connection name> -ResourceGroupName <Resource group name> |
| Check the gateway SKU | az network vnet-gateway show --name "vpn-gateway" --resource-group "test-rg" --query "sku.name" | (Get-AzVirtualNetworkGateway -Name "vpn-gateway" -ResourceGroupName "test-rg").Sku.Name |
| Show the PFS group of a connection's IPsec policy | az network vpn-connection ipsec-policy list --resource-group "<resource-group>" --connection-name "<connection-name>" --query "[].pfsGroup" --output tsv | - |
| Create a custom IPsec/IKE policy object | - | $ipsecpolicy6 = New-AzIpsecPolicy -IkeEncryption AES256 -IkeIntegrity SHA384 -DhGroup DHGroup24 -IpsecEncryption AES256 -IpsecIntegrity SHA256 -PfsGroup None -SALifeTimeSeconds 14400 -SADataSizeKilobytes 102400000 |
| Update the on-premises prefixes of a local network gateway that has a connection (downtime) | az network local-gateway update --local-address-prefixes 10.0.0.0/24 10.3.0.0/16 10.5.0.0/16 10.6.0.0/16 --name VNet1toSite2 -g TestRG1 | - |
| Check that the Extended Network agent runs (on each appliance) | - | get-service extnwagent |
| Task | Azure CLI | PowerShell |
|---|
| Add the RADIUS server and client address pool (IKEv2) | - | Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientAddressPool "172.16.201.0/24" -VpnClientProtocol "IKEv2" -RadiusServerAddress "10.51.0.15" -RadiusServerSecret $Secure_Secret |
| Define two RADIUS servers for high availability | - | $radiusServer1 = New-AzRadiusServer -RadiusServerAddress 10.1.0.15 -RadiusServerSecret $radiuspd -RadiusServerScore 30 |
| Generate RADIUS (EAP-TLS) VPN client configuration | - | New-AzVpnClientConfiguration -ResourceGroupName "TestRG" -Name "VNet1GW" -AuthenticationMethod "EapTls" -RadiusRootCert "<full path name of .cer file containing the RADIUS root>" -ClientRootCert "<full path name of .cer file containing the client root>" | fl |
| Retrieve previously generated client configuration | - | Get-AzVpnClientConfiguration -ResourceGroupName "TestRG" -Name "VNet1GW" | fl |
| Add IKEv2 next to SSTP on a gateway (certificate authentication) | - | Set-AzVirtualNetworkGateway -VirtualNetworkGateway $vng -VpnClientAddressPool <Addresspool> -VpnClientProtocol IkeV2,SSTP -VpnAuthenticationType Certificate -VpnClientRootCertificates $VpnClientRootCert |
| Advertise a custom route to P2S clients | - | Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gw -CustomRoute 203.0.113.250/32 |
| Remove the P2S configuration from a gateway | az network vnet-gateway update --name <gateway-name> --resource-group <resource-group name> --remove "vpnClientConfiguration" | - |
| Install the Azure VPN Client with WinGet | winget install Microsoft.AzureVPNClient --source winget | - |
| Task | Azure CLI | PowerShell |
|---|
| Enrol the subscription for ExpressRoute Direct | - | Register-AzProviderFeature -FeatureName AllowExpressRoutePorts -ProviderNamespace Microsoft.Network |
| Add Azure private peering (IPv4) | - | Add-AzExpressRouteCircuitPeeringConfig -Name "AzurePrivatePeering" -ExpressRouteCircuit $ckt -PeeringType AzurePrivatePeering -PeerASN 100 -PrimaryPeerAddressPrefix "10.0.0.0/30" -SecondaryPeerAddressPrefix "10.0.0.4/30" -VlanId 200 |
| Change the private peering VLAN ID | - | Set-AzExpressRouteCircuitPeeringConfig -Name "AzurePrivatePeering" -ExpressRouteCircuit $ckt -PeeringType AzurePrivatePeering -PeerASN 100 -PrimaryPeerAddressPrefix "10.0.0.0/30" -SecondaryPeerAddressPrefix "10.0.0.4/30" -VlanId 500 |
| Add Microsoft peering (IPv4) | - | Add-AzExpressRouteCircuitPeeringConfig -Name "MicrosoftPeering" -ExpressRouteCircuit $ckt -PeeringType MicrosoftPeering -PeerASN 100 -PeerAddressType IPv4 -PrimaryPeerAddressPrefix "123.0.0.0/30" -SecondaryPeerAddressPrefix "123.0.0.4/30" -VlanId 300 -MicrosoftConfigAdvertisedPublicPrefixes "123.1.0.0/24" -MicrosoftConfigCustomerAsn 23 -MicrosoftConfigRoutingRegistryName "ARIN" |
| Show the private peering configuration | - | Get-AzExpressRouteCircuitPeeringConfig -Name "AzurePrivatePeering" -ExpressRouteCircuit $ckt |
| Show circuit state (provider and circuit status) | - | Get-AzExpressRouteCircuit -ResourceGroupName "Test-ER-RG" -Name "Test-ER-Ckt" |
| Show the ARP table of a peering and path | - | Get-AzExpressRouteCircuitARPTable -ResourceGroupName $RG -ExpressRouteCircuitName $Name -PeeringType AzurePrivatePeering -DevicePath Primary |
| Add the gateway subnet | - | Add-AzVirtualNetworkSubnetConfig -Name GatewaySubnet -VirtualNetwork $vnet -AddressPrefix 192.168.200.0/26 |
| Move a gateway to ErGwScale with autoscaling | - | Set-AzVirtualNetworkGateway -VirtualNetworkGateway $vng -MinScaleUnit 2 -MaxScaleUnit 10 -GatewaySku ErGwScale |
| Delete the ExpressRoute gateway | - | Remove-AzVirtualNetworkGateway -Name $GWName -ResourceGroupName $RG |
| Link a virtual network to a circuit | az network vpn-connection create --name ERConnection --resource-group ExpressRouteResourceGroup --vnet-gateway1 VNet1GW --express-route-circuit2 MyCircuit | $connection = New-AzVirtualNetworkGatewayConnection -Name "ERConnection" -ResourceGroupName "MyRG" -Location "East US" -VirtualNetworkGateway1 $gw -PeerId $circuit.Id -ConnectionType ExpressRoute |
| Create a circuit authorization for another subscription | az network express-route auth create --circuit-name MyCircuit -g ExpressRouteResourceGroup -n MyAuthorization | Add-AzExpressRouteCircuitAuthorization -ExpressRouteCircuit $circuit -Name "MyAuthorization1" |
| Redeem an authorization when creating the connection | az network vpn-connection create --name ERConnection --resource-group ExpressRouteResourceGroup --vnet-gateway1 VNet1GW --express-route-circuit2 MyCircuit --authorization-key "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" | - |
| Set the connection routing weight | az network vpn-connection update --name ERConnection --resource-group ExpressRouteResourceGroup --routing-weight 100 | - |
| Enable FastPath (gateway bypass) on a new connection | az network vpn-connection create --name ERConnection --resource-group ExpressRouteResourceGroup --express-route-gateway-bypass true --vnet-gateway1 VNet1GW --express-route-circuit2 MyCircuit | - |
| Enable FastPath on an existing connection | az network vpn-connection update --name ERConnection --resource-group ExpressRouteResourceGroup --express-route-gateway-bypass true | - |
| Delete a virtual network connection | az network vpn-connection delete --name ERConnection --resource-group ExpressRouteResourceGroup | - |
| Enable Global Reach between two circuits (same subscription) | - | Add-AzExpressRouteCircuitConnectionConfig -Name 'Your_connection_name' -ExpressRouteCircuit $ckt_1 -PeerExpressRouteCircuitPeering $ckt_2.Peerings[0].Id -AddressPrefix '__.__.__.__/29' |
| Disable Global Reach | - | Remove-AzExpressRouteCircuitConnectionConfig -Name "Your_connection_name" -ExpressRouteCircuit $ckt_1 |
| Task | Azure CLI | PowerShell |
|---|
| Create a zone-redundant Standard public IP | az network public-ip create --resource-group load-balancer-cli-rg --name lb-frontend-ip --sku Standard --zone 1 2 3 | New-AzPublicIpAddress @publicip |
| Create a Standard public load balancer | az network lb create --resource-group load-balancer-cli-rg --name load-balancer --sku Standard --public-ip-address lb-frontend-ip --frontend-ip-name lb-frontend --backend-pool-name lb-backend-pool | New-AzLoadBalancer @loadbalancer |
| Create a Standard internal load balancer | az network lb create --resource-group load-balancer-cli-rg --name load-balancer --sku Standard --vnet-name lb-vnet --subnet backend-subnet --backend-pool-name lb-backend-pool --frontend-ip-name lb-frontend | - |
| Create a health probe | az network lb probe create --resource-group load-balancer-cli-rg --lb-name load-balancer --name lb-health-probe --protocol tcp --port 80 | New-AzLoadBalancerProbeConfig @probe |
| Create a load-balancing rule (outbound SNAT off, TCP reset on) | az network lb rule create --resource-group load-balancer-cli-rg --lb-name load-balancer --name lb-HTTP-rule --protocol tcp --frontend-port 80 --backend-port 80 --frontend-ip-name lb-frontend --backend-pool-name lb-backend-pool --probe-name lb-health-probe --disable-outbound-snat true --idle-timeout 15 --enable-tcp-reset true | New-AzLoadBalancerRuleConfig @lbrule -EnableTcpReset -DisableOutboundSNAT |
| Change the distribution mode of a rule (then Set-AzLoadBalancer -LoadBalancer $lb) | az network lb rule update --lb-name myLoadBalancer --load-distribution Default --name myHTTPRule --resource-group myResourceGroupLB | $lb.LoadBalancingRules[0].LoadDistribution = 'default' |
| Check whether a load balancer uses Inbound NAT Pools | az network lb inbound-nat-pool list -g MyResourceGroup --lb-name MyLoadBalancer | $slb.InboundNatPools |
| Create an inbound NAT rule (version 2) on the backend pool | az network lb inbound-nat-rule create -g MyResourceGroup --lb-name MyLoadBalancer -n MyNatRule --protocol Tcp --frontend-port-range-start 201 --frontend-port-range-end 500 --backend-port 22 --backend-address-pool MybackendPool | - |
| Create a Traffic Manager profile (Priority) | az network traffic-manager profile create --name $mytrafficmanagerprofile --resource-group myResourceGroup --routing-method Priority --path '/' --protocol "HTTP" --unique-dns-name $mytrafficmanagerprofile --ttl 30 --port 80 | - |
| Add an Azure endpoint to a profile | az network traffic-manager endpoint create --name $mywebappeastus --resource-group myResourceGroup --profile-name $mytrafficmanagerprofile --type azureEndpoints --target-resource-id $App1ResourceId --priority 1 --endpoint-status Enabled | - |
| Disable a Traffic Manager endpoint | az network traffic-manager endpoint update --name $mywebappeastus --resource-group myResourceGroup --profile-name $mytrafficmanagerprofile --type azureEndpoints --endpoint-status Disabled | - |
| Task | Azure CLI | PowerShell |
|---|
| Create the public IP for the gateway | az network public-ip create --resource-group myResourceGroupAG --name myAGPublicIPAddress --allocation-method Static --sku Standard | - |
| Create a Standard_v2 application gateway | az network application-gateway create --name myAppGateway --location eastus --resource-group myResourceGroupAG --capacity 2 --sku Standard_v2 --public-ip-address myAGPublicIPAddress --vnet-name myVNet --subnet myAGSubnet --servers "$address1" "$address2" --priority 100 | - |
| Check backend health | - | Get-AzApplicationGatewayBackendHealth -Name "appgw1" -ResourceGroupName "rgOne" |
| Stop the gateway | az network application-gateway stop -g MyResourceGroup -n MyAppGateway | - |
| Start the gateway | az network application-gateway start -g MyResourceGroup -n MyAppGateway | - |
| Move the gateway to another subnet in the same virtual network (stop first) | az network application-gateway update -g <ResourceGroup> -n <ApplicationGatewayName> --set gatewayIpConfigurations[0].subnet.id=<subnetID> | - |
| Enable HTTP/2 on listeners (then Set-AzApplicationGateway -ApplicationGateway $gw) | - | $gw.EnableHttp2 = $true |
| Set connection draining (add --connection-draining-timeout; 0 disables, 1 to 3,600 enables) | az network application-gateway http-settings update | - |
| Set the TCP idle timeout of the gateway's public IP (4 to 30 minutes; then Set-AzPublicIpAddress) | - | $publicIP.IdleTimeoutInMinutes = "15" |
| Probe response match for a custom probe | - | $match = New-AzApplicationGatewayProbeHealthResponseMatch -StatusCode 200-399 |
| Task | Azure CLI | PowerShell |
|---|
| Create a private endpoint (dynamic IP) | az network private-endpoint create --connection-name connection-1 --name private-endpoint --private-connection-resource-id $id --resource-group test-rg --subnet subnet-1 --group-id sites --vnet-name vnet-1 | New-AzPrivateEndpoint @pe |
| Static IP at creation | az network private-endpoint create --connection-name connection-1 --name private-endpoint --private-connection-resource-id $id --resource-group test-rg --subnet subnet-1 --group-id sites --ip-config name=ipconfig-1 group-id=sites member-name=sites private-ip-address=10.0.0.10 --vnet-name vnet-1 | - |
| Name the NIC at creation (PowerShell: set CustomNetworkInterfaceName in the @pe parameters) | az network private-endpoint create --connection-name myConnection --name myPrivateEndpoint --private-connection-resource-id $id --resource-group myResourceGroup --subnet myBackendSubnet --group-id sites --nic-name myPrivateEndpointNIC --vnet-name myVNet | New-AzPrivateEndpoint @pe |
| Find GroupId and MemberName | az network private-link-resource list --resource-group MyResourceGroup --name myWebApp1979 --type Microsoft.Web/sites | Get-AzPrivateLinkResource -PrivateLinkResourceId $webapp.ID |
| Enable endpoint network policies on a subnet (PowerShell: PrivateEndpointNetworkPoliciesFlag = 'Enabled' in the @sub parameters) | az network vnet subnet update --disable-private-endpoint-network-policies false --name default --resource-group myResourceGroup --vnet-name myVNet | Set-AzVirtualNetworkSubnetConfig @sub |
| Create a private DNS zone | az network private-dns zone create --resource-group test-rg --name "privatelink.azurewebsites.net" | New-AzPrivateDnsZone |
| Link the zone to a virtual network | az network private-dns link vnet create --resource-group test-rg --zone-name "privatelink.azurewebsites.net" --name dns-link --virtual-network vnet-1 --registration-enabled false | New-AzPrivateDnsVirtualNetworkLink |
| Create a DNS zone group | az network private-endpoint dns-zone-group create --resource-group test-rg --endpoint-name private-endpoint --name zone-group --private-dns-zone "privatelink.azurewebsites.net" --zone-name webapp | New-AzPrivateDnsZoneGroup @zg |
| Approve a connection | az network private-endpoint-connection approve --name myPrivateEndpointConnection --resource-group myResourceGroup | Approve-AzPrivateEndpointConnection @approve |
| Reject a connection | az network private-endpoint-connection reject --name myPrivateEndpointConnection --resource-group myResourceGroup | Deny-AzPrivateEndpointConnection @deny |
| Remove a connection | az network private-endpoint-connection delete --name myPrivateEndpointConnection --resource-group myResourceGroup | Remove-AzPrivateEndpointConnection @remove |
| Disable Private Link service network policy | az network vnet subnet update --name subnet-1 --vnet-name vnet-1 --resource-group test-rg --private-link-service-network-policies Disabled | ($vnet | Select -ExpandProperty subnets | Where-Object {$_.Name -eq $subnet}).privateLinkServiceNetworkPolicies = "Disabled" |
| Create a Private Link service | az network private-link-service create --resource-group test-rg --name private-link-service --vnet-name vnet-1 --subnet subnet-1 --lb-name load-balancer --lb-frontend-ip-configs frontend --location eastus2 | New-AzPrivateLinkService @privlinksettings |
| Task | Azure CLI | PowerShell |
|---|
| Add a subnet with a Storage service endpoint | az network vnet subnet create --vnet-name vnet-1 --resource-group test-rg --name subnet-1 --address-prefix 10.0.0.0/24 --service-endpoints Microsoft.Storage | Add-AzVirtualNetworkSubnetConfig @subnet |
| Deny public access to a storage account by default | az storage account update --name $storageAcctName1 --resource-group test-rg --default-action Deny | - |
| Allow a subnet in the storage firewall | az storage account network-rule add --resource-group test-rg --account-name $storageAcctName1 --vnet-name vnet-1 --subnet subnet-1 | Add-AzStorageAccountNetworkRule @networkRuleParams1 |
| Create a service endpoint policy | az network service-endpoint policy create --resource-group test-rg --name service-endpoint-policy --location westus2 | New-AzServiceEndpointPolicy @sepolicyParams |
| Add a policy definition | az network service-endpoint policy-definition create --resource-group test-rg --policy-name service-endpoint-policy --name policy-definition --service "Microsoft.Storage" --service-resources $serviceResourceId | New-AzServiceEndpointPolicyDefinition @policyDefinitionParams |
| Associate the policy with a subnet | az network vnet subnet update --vnet-name vnet-1 --resource-group test-rg --name subnet-1 --service-endpoints Microsoft.Storage --service-endpoint-policy service-endpoint-policy | Set-AzVirtualNetworkSubnetConfig @subnetConfigParams |
| Task | Azure CLI | PowerShell |
|---|
| Create an NSG | az network nsg create --resource-group myResourceGroup --name myNSG | New-AzNetworkSecurityGroup @NSGParams |
| Add an NSG rule | az network nsg rule create --resource-group myResourceGroup --nsg-name myNSG --name RDP-rule --priority 300 --destination-address-prefixes '*' --destination-port-ranges 3389 --protocol Tcp --description "Allow RDP" | Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $networkSecurityGroup @RuleParams |
| Associate an NSG with a subnet | az network vnet subnet update --resource-group myResourceGroup --vnet-name myVNet --name mySubnet --network-security-group myNSG | Set-AzVirtualNetworkSubnetConfig -VirtualNetwork $virtualNetwork @SubnetParams |
| Associate an NSG with a network interface | az network nic update --name myNIC --resource-group myResourceGroup --network-security-group myNSG | $nic.NetworkSecurityGroup = $nsg; $nic | Set-AzNetworkInterface |
| Create an application security group | az network asg create --resource-group myResourceGroup --name myASG --location eastus | New-AzApplicationSecurityGroup @ASGParams |
| Add a NIC to an application security group | az network nic ip-config update --name ipv4config --nic-name myNIC --resource-group myResourceGroup --application-security-groups myASG | $nic | Set-AzNetworkInterfaceIpConfig @IP; $nic | Set-AzNetworkInterface |
| View a NIC's effective security rules | az network nic list-effective-nsg --name myNIC --resource-group myResourceGroup | Get-AzEffectiveNetworkSecurityGroup -NetworkInterfaceName myNIC -ResourceGroupName myResourceGroup |
| Register the Insights provider (needed for flow logs) | az provider register --namespace Microsoft.Insights | Register-AzResourceProvider -ProviderNamespace Microsoft.Insights |
| Create a virtual network flow log | az network watcher flow-log create --location 'eastus' --resource-group 'myResourceGroup' --name 'myVNetFlowLog' --vnet 'myVNet' --storage-account 'myStorageAccount' | New-AzNetworkWatcherFlowLog -Enabled $true -Name 'myVNetFlowLog' -NetworkWatcherName 'NetworkWatcher_eastus' -ResourceGroupName 'NetworkWatcherRG' -StorageId $storageAccount.Id -TargetResourceId $vnet.Id -FormatVersion 2 |
| Task | Azure CLI | PowerShell |
|---|
| Create the firewall subnet (/26) | az network vnet create --name Test-FW-VN --resource-group Test-FW-RG --location eastus --address-prefix 10.0.0.0/16 --subnet-name AzureFirewallSubnet --subnet-prefix 10.0.1.0/26 | New-AzVirtualNetworkSubnetConfig -Name AzureFirewallSubnet -AddressPrefix 10.0.1.0/26 |
| Create a firewall | az network firewall create --name Test-FW01 --resource-group Test-FW-RG --location eastus | New-AzFirewall -Name Test-FW01 -ResourceGroupName Test-FW-RG -Location "East US" -VirtualNetwork $testVnet -PublicIpAddress $FWpip |
| Create the firewall public IP | az network public-ip create --name fw-pip --resource-group Test-FW-RG --location eastus --allocation-method static --sku standard | New-AzPublicIpAddress -Name "fw-pip" -ResourceGroupName Test-FW-RG -Location "East US" -AllocationMethod Static -Sku Standard |
| Attach the public IP to the firewall | az network firewall ip-config create --firewall-name Test-FW01 --name FW-config --public-ip-address fw-pip --resource-group Test-FW-RG --vnet-name Test-FW-VN | - |
| Create a route table without BGP propagation | az network route-table create --name Firewall-rt-table --resource-group Test-FW-RG --location eastus --disable-bgp-route-propagation true | New-AzRouteTable -Name Firewall-rt-table -ResourceGroupName Test-FW-RG -location "East US" -DisableBgpRoutePropagation |
| Add the default route to the firewall | az network route-table route create --resource-group Test-FW-RG --name DG-Route --route-table-name Firewall-rt-table --address-prefix 0.0.0.0/0 --next-hop-type VirtualAppliance --next-hop-ip-address $fwprivaddr | Add-AzRouteConfig -Name "DG-Route" -RouteTable $routeTableDG -AddressPrefix 0.0.0.0/0 -NextHopType "VirtualAppliance" -NextHopIpAddress $AzfwPrivateIP |
| Add an application rule | az network firewall application-rule create --collection-name App-Coll01 --firewall-name Test-FW01 --name Allow-Microsoft --protocols Http=80 Https=443 --resource-group Test-FW-RG --target-fqdns www.microsoft.com --source-addresses 10.0.2.0/24 --priority 200 --action Allow | New-AzFirewallApplicationRule -Name Allow-Google -SourceAddress 10.0.2.0/24 -Protocol http, https -TargetFqdn www.google.com |
| Add a network rule | az network firewall network-rule create --collection-name Net-Coll01 --destination-addresses <replace with DNS ip #1> <replace with DNS ip #2> --destination-ports 53 --firewall-name Test-FW01 --name Allow-DNS --protocols UDP --resource-group Test-FW-RG --priority 200 --source-addresses 10.0.2.0/24 --action Allow | New-AzFirewallNetworkRule -Name "Allow-DNS" -Protocol UDP -SourceAddress 10.0.2.0/24 -DestinationAddress 209.244.0.3,209.244.0.4 -DestinationPort 53 |
| Set custom DNS servers | az network firewall update --name fwName --resource-group fwRG --dns-servers 10.1.0.4 10.1.0.5 | $azFw.DNSServer = $dnsServers; $azFw | Set-AzFirewall |
| Stop (deallocate) a firewall | - | $azfw.Deallocate(); Set-AzFirewall -AzureFirewall $azfw |
| Task | Azure CLI | PowerShell |
|---|
| Show Application Gateway WAF policy settings | - | $plcy = Get-AzApplicationGatewayFirewallPolicy -Name <policy-name> -ResourceGroupName <resourcegroup-name>; $plcy.PolicySettings |
| Set request body inspection and size limits on an Application Gateway WAF policy | az network application-gateway waf-policy update --name <WAF Policy name> --resource-group <WAF policy RG> --set policySettings.request_body_inspect_limit_in_kb='128' policySettings.max_request_body_size_in_kb='128' policySettings.file_upload_limit_in_mb='100' --query policySettings -o table | $plcy.PolicySettings.RequestBodyEnforcement=false; Set-AzApplicationGatewayFirewallPolicy -InputObject $plcy |
| Put an Application Gateway WAF in force mode (associate any policy) | - | $appgw = Get-AzApplicationGateway -Name <your Application Gateway name> -ResourceGroupName <your Resource Group name>; $appgw.ForceFirewallPolicyAssociation = $true |
These topic pages have no CLI or PowerShell table, so nothing from them is repeated here: Virtual WAN.