skip to Main Content

I am trying to disable Public Network Access of Azure Data Factory through az powershell. As per Microsoft documentation, there is a property called PublicNetworkAccess. So I tried below commands,

Import-Module Az.DataFactory
Set-AzDataFactoryV2 -PublicNetworkAccess 'Disabled' -Force

But it gave me below error,
error

Could anyone please guide me?
My end goal is to achieve below configuration in Azure Data Factory (Connect via Private Endpoint):
Network Access via ADF Private Endpoint

2

Answers


  1. You need to pass DataFactoryName,ResourceGroupName,location to the Set-AzDatatFactoryV2 cmdlet in order to disable the public Network Access on the Data Factory.

    We have tested the below PowerShell cmdlet, and we are able to disable the public Network Access on Data Factory.

    Set-AzDataFactoryV2 -ResourceGroupName '<resourcegroupName>' -Name '<dataFactoryName>' -Location '<locationOfDataFactory>' -PublicNetworkAccess disabled
    

    Here is the Sample Output screenshot for reference:

    enter image description here

    Login or Signup to reply.
  2. Import-Module Az.DataFactory
    Set-AzDataFactoryV2 -PublicNetworkAccess 'Disabled' -Force
    

    The above script which you mentioned is working fine. You just need to type the Resource group name, Data factory name and location after executing it like below.

    enter image description here

    You can see my PublicNetworkAccess is Disabled above and below in the Data factory as well.

    enter image description here

    My Az module version is 8.0.0 and Az.Accounts module version is 2.8.0 and Az.Resources version is 6.0.0.

    So, may be the issue arise due to the Az modules version.

    Please check the version of the modules with the command below

    Get-InstalledModule -Name Az
    

    Try to upgrade the Az module, Az.Accounts and Az.Resources modules in the portal and check the versions again and try the PublicNetworkAccess after that. It may work.

    Please refer Microsoft Documentation to upgrade the Az modules.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search