Reputation: 17
In Azure Data Factory under the Settings options of "Networking", we have to disable the "Public Network Access", under the "Network access" option. If the public network access is "Enabled" then it is Open to Internet, which states that - "All Networks, including Internet can access Data Factory". And this is more threat of exposing the Data Factory to internet. For which we need a power-shell/AZ CLI command which will help us to disable the 'Public Network Access".
Upvotes: 1
Views: 1372
Reputation: 16401
You could set it with properties.publicNetworkAccess
, please see the code bellow:
Connect-AzAccount
$a= Get-AzResource -ResourceType Microsoft.DataFactory/factories -ResourceGroupName ChinaCXPTeam-Resources -ResourceName dfleon
$a.Properties.publicNetworkAccess = "Disabled"
$a | Set-AzResource -Force
Here are the module versions I use:
Update:
This command also works well:
$a = Get-AzResource -ResourceType Microsoft.DataFactory/factories -ResourceGroupName "<resource-group-name>" -ResourceName "<datafactory-name>"
$a.Properties | Add-Member -MemberType NoteProperty -Name "publicNetworkAccess" -Value "Disabled" -Force
$a | Set-AzResource -Force
Upvotes: 1