You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran through a POC setup last week and was having an issue with CreateSubnetInjectionEnterprisePolicy.ps1. The script was failing (404 - Environment not found) when trying to get the Power environment I was specifying in the script.
I traced the issue back to the GetEnvironmentFromBAP function in the EnvironmentOperations.ps1 script. It seems that for some reason the API was not taking the environment ID directly, but I was able to use the same API to enumerate all my environments. I then looked at the PowerApps Administration PowerShell module code to see how they were doing pulling environments in the Get-AdminPowerAppEnvironment cmdlet. In this function they were enumerating all environments (which I had no issues doing) and then filtering by name.
I re-wrote the GetEnvironmentFromBAP function to enumerate all environments and then filter by id and was able to get everything to work after. I'm not sure if pagination comes into play with this API, but we don't have enough environments to hit that. I tried to look more into this BAP API, but was unable to find any real documentation on it.
Ran through a POC setup last week and was having an issue with CreateSubnetInjectionEnterprisePolicy.ps1. The script was failing (404 - Environment not found) when trying to get the Power environment I was specifying in the script.
I traced the issue back to the GetEnvironmentFromBAP function in the EnvironmentOperations.ps1 script. It seems that for some reason the API was not taking the environment ID directly, but I was able to use the same API to enumerate all my environments. I then looked at the PowerApps Administration PowerShell module code to see how they were doing pulling environments in the Get-AdminPowerAppEnvironment cmdlet. In this function they were enumerating all environments (which I had no issues doing) and then filtering by name.
I re-wrote the GetEnvironmentFromBAP function to enumerate all environments and then filter by id and was able to get everything to work after. I'm not sure if pagination comes into play with this API, but we don't have enough environments to hit that. I tried to look more into this BAP API, but was unable to find any real documentation on it.
Original function:
Modified function:
The text was updated successfully, but these errors were encountered: