microsoft / EntraExporter

PowerShell module to export a local copy of an Entra (Azure AD) tenant configuration.
https://aka.ms/EntraExporter
MIT License
572 stars 92 forks source link

Use EntrExporter behind corporative proxy #66

Open dcandela12 opened 5 months ago

dcandela12 commented 5 months ago

I'm trying to automate the process via Azure DevOps, and I want to use a self-hosted agent but this one is behind a corporate proxy to navigate through internet, so I've been checking the automation from devops running the Entra-Exporter module and have been doing the tests, but the error I get is Unable to connect to the remote server, doing some troubleshooting is because the module is not pulling the traffic through the proxy, I was wondering if it is possible to somehow use Entra-Exporter via proxy. Otherwise I could not run it because it exceeds more than 60m export on an Azure agent and gives me timeout.

@merill there is any option to execute this with proxy?

SamErde commented 4 months ago

The Microsoft\CSS-Exchange repo has a couple of great shared functions that help detect and negotiate proxy servers for their scripts. Check the ScriptUpdateFunctions folder for potential solutions in Invoke-WebRequestWithProxyDetection.ps1 and Confirm-ProxyServer.ps1. (I also like the model they built for scripts that check for newer versions!)

merill commented 4 months ago

We use Graph PowerShell so the proxy support will need to come from there.

It looks like you can follow the general PowerShell options to set a proxy. See this blog post for options.

https://woshub.com/using-powershell-behind-a-proxy/

SamErde commented 4 months ago

As a side note, if you can already connect to the Graph API on your own, you can skip the Connect-EntraExporter function and just run Export-Entra with your desired parameters.