Reputation: 39
Powershell command to Change Public Access of Data Factory from Enabled
to Disabled
.
This is coming under the Networking
options of the Data Factory.
Upvotes: 0
Views: 400
Reputation: 42063
Just use the command below, it works on my side.
$factory = Get-AzResource -ResourceType Microsoft.DataFactory/factories -ResourceGroupName <resource-group-name> -ResourceName <datafactory-name>
$factory.Properties.publicNetworkAccess = "Disabled"
$factory | Set-AzResource -Force
Check in the portal:
Update:
You could use the command below, no matter you have changed the setting or not.
$factory = Get-AzResource -ResourceType Microsoft.DataFactory/factories -ResourceGroupName "<resource-group-name>" -ResourceName "<datafactory-name>"
$factory.Properties | Add-Member -MemberType NoteProperty -Name "publicNetworkAccess" -Value "Disabled" -Force
$factory | Set-AzResource -Force
Upvotes: 2