PowerApps-Samples icon indicating copy to clipboard operation
PowerApps-Samples copied to clipboard

Error with creating enterprise policy for subnet injection

Open robjdav opened this issue 1 year ago • 2 comments

Identical to this issue (closed with no resolution provided) , I'm trying to create a power platform enterprise policy for subnet injection with Bicep. However, the deployment fails with the following error:

"Failed to create or update the enterprise policy, request body is null. (Code: InputValidationError)"

Bicep code for this is below (taken from here )

resource enterprisePolicy 'Microsoft.PowerPlatform/enterprisePolicies@2020-10-30-preview' = {
  name: 'policyName'
  location: 'UK'
  kind: 'NetworkInjection'
  properties: {
    networkInjection: {
      virtualNetworks: {
        value: [
          {
            id: vNet.id
            subnet: {
              name: 'PPSubnet1'
            }
          }
          {
            id: vNet.id
            subnet: {
              name: 'PPSubnet2'
            }
          }
        ]
      }
    }
  }
}

robjdav avatar Aug 05 '24 12:08 robjdav

HI I am looking for the bicep code whcih can run enterprise policy to integrate powerapps with azure... I need to automate this please help em if you have it

Haps1976 avatar Oct 19 '24 14:10 Haps1976

Looks like the internal contract is

virtualNetworks: [
   {
      id: vNet.id
      subnet: {
        name: 'PPSubnet1'
      }
   },
   {
       id: vNet.id
       subnet: {
         name: 'PPSubnet2'
       }
   }
]

we are looking at why the docs and contract are different

sadjadbp avatar Nov 05 '24 17:11 sadjadbp

looks like this is up to date already

faix avatar Aug 11 '25 18:08 faix