Firewall turn on

Efff dd 576 Reputation points
2024-12-23T19:01:42.0866667+00:00

https://learn.microsoft.com/en-us/azure/firewall/firewall-faq#how-can-i-stop-and-start-azure-firewall

using the instructions awhile back to save $$, we disabled the farewell, now I need to turn it back on.

Wanting to stay with this docs by MS.

what do i populate for the $publicip* fields with?

$azfw = Get-AzFirewall -Name "FW Name" -ResourceGroupName "RG Name"
$vnet = Get-AzVirtualNetwork -ResourceGroupName "RG Name" -Name "VNet Name"
$publicip1 = Get-AzPublicIpAddress -Name "Public IP1 Name" -ResourceGroupName "RG Name"
$publicip2 = Get-AzPublicIpAddress -Name "Public IP2 Name" -ResourceGroupName "RG Name"
$azfw.Allocate($vnet,@($publicip1,$publicip2))
Set-AzFirewall -AzureFirewall $azfw
PS> Get-AzPublicIpAddress
ResourceGroupName Name  PublicIpAllocationMethod IpAddress      PublicIpAddressVersion 
-------- ------------------------ ---------      ---------------------- -----
tur-rg-hub-prod   TUR-pip-afw-client-prod    Static                   156.xx.xxx.xxx IPv4                   
tur-rg-hub-prod   TUR-pip-afw-mgmt-prod      Static                   156.xx.xxx.xx  IPv4                   
tur-rg-hub-prod   TUR-pip-bas-prod           Static                   21.xx.xxx.xx   IPv4                   
tur-rg-hub-prod   TUR-s2s-vpn-pip-prod       Static                   172.xxx.xxx.xx IPv4                   
Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
703 questions
{count} votes

Accepted answer
  1. hossein jalilian 9,535 Reputation points
    2024-12-23T19:04:41.9666667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    You should populate the $publicip* fields with the public IP addresses associated with your Azure Firewall. In this case, you have two relevant public IP addresses:

    • TUR-pip-afw-client-prod
    • TUR-pip-afw-mgmt-prod

    Here's how you should modify the PowerShell script to turn on your Azure Firewall:

    $azfw = Get-AzFirewall -Name "Your-Firewall-Name" -ResourceGroupName "tur-rg-hub-prod"
    $vnet = Get-AzVirtualNetwork -ResourceGroupName "tur-rg-hub-prod" -Name "Your-VNet-Name"
    $publicip1 = Get-AzPublicIpAddress -Name "TUR-pip-afw-client-prod" -ResourceGroupName "tur-rg-hub-prod"
    $publicip2 = Get-AzPublicIpAddress -Name "TUR-pip-afw-mgmt-prod" -ResourceGroupName "tur-rg-hub-prod"
    $azfw.Allocate($vnet,@($publicip1,$publicip2))
    Set-AzFirewall -AzureFirewall $azfw
    
    

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.