Anirudh B
Anirudh B

Reputation: 39

Powershell command to Change Public Access of Data Factory from Enable to Disabled

Powershell command to Change Public Access of Data Factory from Enabled to Disabled. This is coming under the Networking options of the Data Factory.

enter image description here

Upvotes: 0

Views: 400

Answers (1)

Joy Wang
Joy Wang

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

enter image description here

Check in the portal:

enter image description here

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

enter image description here

Upvotes: 2

Related Questions