Skip to main content
Install Azure PowerShell Cmdlets through proxy
  1. Posts/

Install Azure PowerShell Cmdlets through proxy

·232 words·2 mins
Christoph Petersen
Author
Christoph Petersen
Photo by rawpixel on Unsplash

When setting up Azure File Sync one of the requirements is to have the Azure PowerShell Cmdlets (AzureRM) installed. Many customers have proxies deployed which control internet egress. Many of these also use authentication to secure internet access.

In order to tunnel the installation of packages from PowerShell Gallery through a proxy the configuration for that package source needs to be updated to include the proxy. As far as I know the system proxy settings are NOT respected.

Follow the following steps to enable package management to use a proxy when downloading packages:

Configuring proxy (w/o auth)
#

Set-PackageSource -Name PSGallery -Proxy http://my.proxy.local:3128

Configuring proxy (w/ auth)
#

$credential = Get-Credential
Set-PackageSource -Name PSGallery -Proxy http://my.proxy.local:3128 -ProxyCredential $credential

Change default source location
#

During installation of Windows the default PSGallery package source is added. This source has a default address which can’t be overriden manually. During registration of this source the location is internally looked up. If this call is intercepted by a proxy or other network device and redirected to an other location you need to re-register the package source.

The output of Get-PackageSource should be similar to this:

2018-08-14-07_17_43-Windows-PowerShell

Re-register package source (w/o auth)
#

Unregister-PackageSource -Name PSGallery
Register-PackageSource -Name PSGallery -ProviderName PowerShellGet -Proxy http://my.proxy.local:3128

Re-register package source (w/ auth)
#

$credential = Get-Credential
Unregister-PackageSource -Name PSGallery
Register-PackageSource -Name PSGallery -ProviderName PowerShellGet -Proxy http://my.proxy.local:3128 -ProxyCredential $credential

Related

Publish to social with Logic Apps

·1119 words·6 mins
Photo by rawpixel on Unsplash I like to share on LinkedIn and asked myself why I’m not sharing the articles I write for my blog. The you-just-have-to-do-it factor, plain laziness and lack of time are the primary reasons why I have not posted links to LinkedIn so far.

Azure Security Center per-hour billing

·89 words·1 min
Photo by rawpixel on Unsplash Currently billing for Azure Security Center is reported on a per-node, per-month basis. Starting July 1st 2018 this reporting will be changed to per-node, per-hour to achieve more granularity in billing. Billing is still pro-rated thus you’ll only pay for the time a node was actually using the service.