Create Azure Endpoints without port probing for passive mode FTP servers

The Azure management portal cannot create endpoints for FTP servers in passive mode, because it does configure probe ports that are the same as the endpoint port - and since there is no serivce listening on this port the probe fails.
created by on 2013-07-26

Port probing must be disabled for endpoint that shall be used for passive FTP:

Screenshot of two Azure endpoint. The left one with port probing configured and the right one without port probing

The problem is, that port probing can only be disabled when using the PowerShell API for Azure and not with the Management console.

Windows Azure PowerShell Module

To access Windows Azure via Windows PowerShell you must install the Windows Azure module for Windows PowerShell.

Once thats done you can import the Azure module into your PowerShell session:

Set-ExecutionPolicy RemoteSigned
Import-Module "C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1"

Set your Azure Subscription

Before you can start working with Windows Azure an PowerShell you need to apply your supscription settings.

Download your subscription settings:

Get-AzurePublishSettingsFile

Screenshot: The website which opens when you use the command Get-AzurePublishSettingsFile. The page will download your subscription file.

Then you can import your subscription settings:

Import-AzurePublishSettingsFile .\your-azure.publishsettings

Get an endpoint

Get a list of all endpoints for a vm

Get-AzureVM –ServiceName "<servicename>" –Name "<vm-name>" | Get-AzureEndpoint

Screenshot: Get all endpoints for an azure vm

Get a specific endpoint

Get-AzureVM –ServiceName "<servicename>" –Name "<vm-name>" | Get-AzureEndpoint -Name "<endpoint-name>"

Screenshot: Get a specific Azure endpoinit

Remove an Azure Endpoit

Get-AzureVM –ServiceName "<servicename>" –Name "<vm-name>" | Remove-AzureEndpoint –Name "<endpoint-name>" | Update-AzureVM

Screenshot: Removing an Azure endpoint

Create new endpoints for a passive FTP server

Use the Azure Endpoint Creation script from github.com/sandrinodimattia/WindowsAzure-PassiveFTPinVM to create the ports for a passive FTP server on Azure:

$vm = Get-AzureVM "<vm-name>"
.\Add-AzureFtpEndpoints.ps1 -vm $vm -publicPort 21 -dynamicPortFirst 25003 -dynamicPortLast 25006

Screenshot: Creating Azure Endpoints without port probing

Related Links

Tags: