Windows Azure Deployment – Problem and Solution #1

Note: I will start posting the series of “Problem/Solution” posts for Windows Azure deployment. As I intend to reach out to those people who have the same problem and search in Google or Bing, I will post the code, error message, output message  in details. Hence, that will make the post longer but I already told you about my intention. If you like to share your experience with Azure (esp: deployment), please feel free to share with me. 

Scott wrote a great post “CI DEPLOYMENT OF AZURE WEB ROLES USING TEAMCITY” about deploying Azure webrole from Azure PowerShell SDK. I used it as a reference when I was deploying one website and windows service to Azure web role and woker role but due to my settings that Scott might not have, I have to update a few things for his script. I am sharing it here for those who might have the same setting as I have.

Contents

Note: ScottGu announced about the release of Windows Azure SDK 2.2 (Please refer to this link Windows Azure: Announcing release of Windows Azure SDK 2.2 (with lots of goodies) for more information a few days back. But that version wasn’t available when I was playing around with Azure. All API that I used and the experience that I had comes from SDK 2.1.

Problem: Error in importing the module

You need to import the Azure module before you start doing anything with Azure CmdLet but if there is more than


Write-Output "Running Azure Imports"
Import-Module "C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\*.psd1"

Error Message

Import-Module : Path cannot be processed because it resolved to more than one file; can process only one file at a
time.
At line:1 char:1
+ Import-Module “C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Az …
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Collecti…[System.String]:Collection`1) [Import-Module], Runt
imeException
+ FullyQualifiedErrorId : AmbiguousPath,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Azure

Solution

Use Azure.psd1 instead.


Write-Output "Running Azure Imports"
Import-Module "C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1"

Output
PS C:\> Import-Module “C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1”
VERBOSE: Loading module from path ‘C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1’.
VERBOSE: Importing cmdlet ‘Add-AzureCacheWorkerRole’.
VERBOSE: Importing cmdlet ‘Add-AzureCertificate’.
VERBOSE: Importing cmdlet ‘Add-AzureDataDisk’.
VERBOSE: Importing cmdlet ‘Add-AzureDisk’.
VERBOSE: Importing cmdlet ‘Add-AzureDjangoWebRole’.
VERBOSE: Importing cmdlet ‘Add-AzureEndpoint’.
VERBOSE: Importing cmdlet ‘Add-AzureEnvironment’.
VERBOSE: Importing cmdlet ‘Add-AzureNodeWebRole’.
VERBOSE: Importing cmdlet ‘Add-AzureNodeWorkerRole’.
VERBOSE: Importing cmdlet ‘Add-AzurePHPWebRole’.
VERBOSE: Importing cmdlet ‘Add-AzurePHPWorkerRole’.
VERBOSE: Importing cmdlet ‘Add-AzureProvisioningConfig’.
VERBOSE: Importing cmdlet ‘Add-AzureVhd’.
VERBOSE: Importing cmdlet ‘Add-AzureVMImage’.
VERBOSE: Importing cmdlet ‘Add-AzureWebRole’.
VERBOSE: Importing cmdlet ‘Add-AzureWorkerRole’.
VERBOSE: Importing cmdlet ‘Disable-AzureServiceProjectRemoteDesktop’.
VERBOSE: Importing cmdlet ‘Disable-AzureWebsiteApplicationDiagnostic’.
VERBOSE: Importing cmdlet ‘Enable-AzureMemcacheRole’.
VERBOSE: Importing cmdlet ‘Enable-AzureServiceProjectRemoteDesktop’.
VERBOSE: Importing cmdlet ‘Enable-AzureWebsiteApplicationDiagnostic’.
VERBOSE: Importing cmdlet ‘Export-AzureVM’.
VERBOSE: Importing cmdlet ‘Get-AzureAclConfig’.
VERBOSE: Importing cmdlet ‘Get-AzureAffinityGroup’.
VERBOSE: Importing cmdlet ‘Get-AzureCertificate’.
VERBOSE: Importing cmdlet ‘Get-AzureDataDisk’.
VERBOSE: Importing cmdlet ‘Get-AzureDeployment’.
VERBOSE: Importing cmdlet ‘Get-AzureDisk’.
VERBOSE: Importing cmdlet ‘Get-AzureDns’.
VERBOSE: Importing cmdlet ‘Get-AzureEndpoint’.
VERBOSE: Importing cmdlet ‘Get-AzureEnvironment’.
VERBOSE: Importing cmdlet ‘Get-AzureLocation’.
VERBOSE: Importing cmdlet ‘Get-AzureMediaServicesAccount’.
VERBOSE: Importing cmdlet ‘Get-AzureOSDisk’.
VERBOSE: Importing cmdlet ‘Get-AzureOSVersion’.
VERBOSE: Importing cmdlet ‘Get-AzurePublishSettingsFile’.
VERBOSE: Importing cmdlet ‘Get-AzureRemoteDesktopFile’.
VERBOSE: Importing cmdlet ‘Get-AzureRole’.
VERBOSE: Importing cmdlet ‘Get-AzureSBAuthorizationRule’.
VERBOSE: Importing cmdlet ‘Get-AzureSBLocation’.
VERBOSE: Importing cmdlet ‘Get-AzureSBNamespace’.
VERBOSE: Importing cmdlet ‘Get-AzureService’.
VERBOSE: Importing cmdlet ‘Get-AzureServiceDiagnosticsExtension’.
VERBOSE: Importing cmdlet ‘Get-AzureServiceProjectRoleRuntime’.
VERBOSE: Importing cmdlet ‘Get-AzureServiceRemoteDesktopExtension’.
VERBOSE: Importing cmdlet ‘Get-AzureSqlDatabase’.
VERBOSE: Importing cmdlet ‘Get-AzureSqlDatabaseImportExportStatus’.
VERBOSE: Importing cmdlet ‘Get-AzureSqlDatabaseServer’.
VERBOSE: Importing cmdlet ‘Get-AzureSqlDatabaseServerFirewallRule’.
VERBOSE: Importing cmdlet ‘Get-AzureSqlDatabaseServerQuota’.
VERBOSE: Importing cmdlet ‘Get-AzureSqlDatabaseServiceObjective’.
VERBOSE: Importing cmdlet ‘Get-AzureStorageAccount’.
VERBOSE: Importing cmdlet ‘Get-AzureStorageBlob’.
VERBOSE: Importing cmdlet ‘Get-AzureStorageBlobContent’.
VERBOSE: Importing cmdlet ‘Get-AzureStorageBlobCopyState’.
VERBOSE: Importing cmdlet ‘Get-AzureStorageContainer’.
VERBOSE: Importing cmdlet ‘Get-AzureStorageKey’.
VERBOSE: Importing cmdlet ‘Get-AzureStorageQueue’.
VERBOSE: Importing cmdlet ‘Get-AzureStorageTable’.
VERBOSE: Importing cmdlet ‘Get-AzureStoreAddOn’.
VERBOSE: Importing cmdlet ‘Get-AzureSubnet’.
VERBOSE: Importing cmdlet ‘Get-AzureSubscription’.
VERBOSE: Importing cmdlet ‘Get-AzureVM’.
VERBOSE: Importing cmdlet ‘Get-AzureVMImage’.
VERBOSE: Importing cmdlet ‘Get-AzureVNetConfig’.
VERBOSE: Importing cmdlet ‘Get-AzureVNetConnection’.
VERBOSE: Importing cmdlet ‘Get-AzureVNetGateway’.
VERBOSE: Importing cmdlet ‘Get-AzureVNetGatewayKey’.
VERBOSE: Importing cmdlet ‘Get-AzureVNetSite’.
VERBOSE: Importing cmdlet ‘Get-AzureWebsite’.
VERBOSE: Importing cmdlet ‘Get-AzureWebsiteDeployment’.
VERBOSE: Importing cmdlet ‘Get-AzureWebsiteLocation’.
VERBOSE: Importing cmdlet ‘Get-AzureWebsiteLog’.
VERBOSE: Importing cmdlet ‘Get-AzureWinRMUri’.
VERBOSE: Importing cmdlet ‘Import-AzurePublishSettingsFile’.
VERBOSE: Importing cmdlet ‘Import-AzureVM’.
VERBOSE: Importing cmdlet ‘Move-AzureDeployment’.
VERBOSE: Importing cmdlet ‘New-AzureAclConfig’.
VERBOSE: Importing cmdlet ‘New-AzureAffinityGroup’.
VERBOSE: Importing cmdlet ‘New-AzureCertificateSetting’.
VERBOSE: Importing cmdlet ‘New-AzureDeployment’.
VERBOSE: Importing cmdlet ‘New-AzureDns’.
VERBOSE: Importing cmdlet ‘New-AzureMediaServicesAccount’.
VERBOSE: Importing cmdlet ‘New-AzureMediaServicesKey’.
VERBOSE: Importing cmdlet ‘New-AzureQuickVM’.
VERBOSE: Importing cmdlet ‘New-AzureRoleTemplate’.
VERBOSE: Importing cmdlet ‘New-AzureSBAuthorizationRule’.
VERBOSE: Importing cmdlet ‘New-AzureSBNamespace’.
VERBOSE: Importing cmdlet ‘New-AzureService’.
VERBOSE: Importing cmdlet ‘New-AzureServiceDiagnosticsExtensionConfig’.
VERBOSE: Importing cmdlet ‘New-AzureServiceProject’.
VERBOSE: Importing cmdlet ‘New-AzureServiceRemoteDesktopExtensionConfig’.
VERBOSE: Importing cmdlet ‘New-AzureSqlDatabase’.
VERBOSE: Importing cmdlet ‘New-AzureSqlDatabaseServer’.
VERBOSE: Importing cmdlet ‘New-AzureSqlDatabaseServerContext’.
VERBOSE: Importing cmdlet ‘New-AzureSqlDatabaseServerFirewallRule’.
VERBOSE: Importing cmdlet ‘New-AzureSSHKey’.
VERBOSE: Importing cmdlet ‘New-AzureStorageAccount’.
VERBOSE: Importing cmdlet ‘New-AzureStorageContainer’.
VERBOSE: Importing cmdlet ‘New-AzureStorageContext’.
VERBOSE: Importing cmdlet ‘New-AzureStorageKey’.
VERBOSE: Importing cmdlet ‘New-AzureStorageQueue’.
VERBOSE: Importing cmdlet ‘New-AzureStorageTable’.
VERBOSE: Importing cmdlet ‘New-AzureStoreAddOn’.
VERBOSE: Importing cmdlet ‘New-AzureVM’.
VERBOSE: Importing cmdlet ‘New-AzureVMConfig’.
VERBOSE: Importing cmdlet ‘New-AzureVNetGateway’.
VERBOSE: Importing cmdlet ‘New-AzureWebsite’.
VERBOSE: Importing cmdlet ‘Publish-AzureServiceProject’.
VERBOSE: Importing cmdlet ‘Remove-AzureAclConfig’.
VERBOSE: Importing cmdlet ‘Remove-AzureAffinityGroup’.
VERBOSE: Importing cmdlet ‘Remove-AzureCertificate’.
VERBOSE: Importing cmdlet ‘Remove-AzureDataDisk’.
VERBOSE: Importing cmdlet ‘Remove-AzureDeployment’.
VERBOSE: Importing cmdlet ‘Remove-AzureDisk’.
VERBOSE: Importing cmdlet ‘Remove-AzureEndpoint’.
VERBOSE: Importing cmdlet ‘Remove-AzureEnvironment’.
VERBOSE: Importing cmdlet ‘Remove-AzureMediaServicesAccount’.
VERBOSE: Importing cmdlet ‘Remove-AzureSBAuthorizationRule’.
VERBOSE: Importing cmdlet ‘Remove-AzureSBNamespace’.
VERBOSE: Importing cmdlet ‘Remove-AzureService’.
VERBOSE: Importing cmdlet ‘Remove-AzureServiceDiagnosticsExtension’.
VERBOSE: Importing cmdlet ‘Remove-AzureServiceRemoteDesktopExtension’.
VERBOSE: Importing cmdlet ‘Remove-AzureSqlDatabase’.
VERBOSE: Importing cmdlet ‘Remove-AzureSqlDatabaseServer’.
VERBOSE: Importing cmdlet ‘Remove-AzureSqlDatabaseServerFirewallRule’.
VERBOSE: Importing cmdlet ‘Remove-AzureStorageAccount’.
VERBOSE: Importing cmdlet ‘Remove-AzureStorageBlob’.
VERBOSE: Importing cmdlet ‘Remove-AzureStorageContainer’.
VERBOSE: Importing cmdlet ‘Remove-AzureStorageQueue’.
VERBOSE: Importing cmdlet ‘Remove-AzureStorageTable’.
VERBOSE: Importing cmdlet ‘Remove-AzureStoreAddOn’.
VERBOSE: Importing cmdlet ‘Remove-AzureSubscription’.
VERBOSE: Importing cmdlet ‘Remove-AzureVM’.
VERBOSE: Importing cmdlet ‘Remove-AzureVMImage’.
VERBOSE: Importing cmdlet ‘Remove-AzureVNetConfig’.
VERBOSE: Importing cmdlet ‘Remove-AzureVNetGateway’.
VERBOSE: Importing cmdlet ‘Remove-AzureWebsite’.
VERBOSE: Importing cmdlet ‘Reset-AzureRoleInstance’.
VERBOSE: Importing cmdlet ‘Restart-AzureVM’.
VERBOSE: Importing cmdlet ‘Restart-AzureWebsite’.
VERBOSE: Importing cmdlet ‘Restore-AzureWebsiteDeployment’.
VERBOSE: Importing cmdlet ‘Save-AzureServiceProjectPackage’.
VERBOSE: Importing cmdlet ‘Save-AzureVhd’.
VERBOSE: Importing cmdlet ‘Save-AzureVMImage’.
VERBOSE: Importing cmdlet ‘Save-AzureWebsiteLog’.
VERBOSE: Importing cmdlet ‘Select-AzureSubscription’.
VERBOSE: Importing cmdlet ‘Set-AzureAclConfig’.
VERBOSE: Importing cmdlet ‘Set-AzureAffinityGroup’.
VERBOSE: Importing cmdlet ‘Set-AzureAvailabilitySet’.
VERBOSE: Importing cmdlet ‘Set-AzureDataDisk’.
VERBOSE: Importing cmdlet ‘Set-AzureDeployment’.
VERBOSE: Importing cmdlet ‘Set-AzureEndpoint’.
VERBOSE: Importing cmdlet ‘Set-AzureEnvironment’.
VERBOSE: Importing cmdlet ‘Set-AzureLoadBalancedEndpoint’.
VERBOSE: Importing cmdlet ‘Set-AzureOSDisk’.
VERBOSE: Importing cmdlet ‘Set-AzureRole’.
VERBOSE: Importing cmdlet ‘Set-AzureSBAuthorizationRule’.
VERBOSE: Importing cmdlet ‘Set-AzureService’.
VERBOSE: Importing cmdlet ‘Set-AzureServiceDiagnosticsExtension’.
VERBOSE: Importing cmdlet ‘Set-AzureServiceProject’.
VERBOSE: Importing cmdlet ‘Set-AzureServiceProjectRole’.
VERBOSE: Importing cmdlet ‘Set-AzureServiceRemoteDesktopExtension’.
VERBOSE: Importing cmdlet ‘Set-AzureSqlDatabase’.
VERBOSE: Importing cmdlet ‘Set-AzureSqlDatabaseServer’.
VERBOSE: Importing cmdlet ‘Set-AzureSqlDatabaseServerFirewallRule’.
VERBOSE: Importing cmdlet ‘Set-AzureStorageAccount’.
VERBOSE: Importing cmdlet ‘Set-AzureStorageBlobContent’.
VERBOSE: Importing cmdlet ‘Set-AzureStorageContainerAcl’.
VERBOSE: Importing cmdlet ‘Set-AzureStoreAddOn’.
VERBOSE: Importing cmdlet ‘Set-AzureSubnet’.
VERBOSE: Importing cmdlet ‘Set-AzureSubscription’.
VERBOSE: Importing cmdlet ‘Set-AzureVMSize’.
VERBOSE: Importing cmdlet ‘Set-AzureVNetConfig’.
VERBOSE: Importing cmdlet ‘Set-AzureVNetGateway’.
VERBOSE: Importing cmdlet ‘Set-AzureWalkUpgradeDomain’.
VERBOSE: Importing cmdlet ‘Set-AzureWebsite’.
VERBOSE: Importing cmdlet ‘Show-AzurePortal’.
VERBOSE: Importing cmdlet ‘Show-AzureWebsite’.
VERBOSE: Importing cmdlet ‘Start-AzureEmulator’.
VERBOSE: Importing cmdlet ‘Start-AzureService’.
VERBOSE: Importing cmdlet ‘Start-AzureSqlDatabaseExport’.
VERBOSE: Importing cmdlet ‘Start-AzureSqlDatabaseImport’.
VERBOSE: Importing cmdlet ‘Start-AzureStorageBlobCopy’.
VERBOSE: Importing cmdlet ‘Start-AzureVM’.
VERBOSE: Importing cmdlet ‘Start-AzureWebsite’.
VERBOSE: Importing cmdlet ‘Stop-AzureEmulator’.
VERBOSE: Importing cmdlet ‘Stop-AzureService’.
VERBOSE: Importing cmdlet ‘Stop-AzureStorageBlobCopy’.
VERBOSE: Importing cmdlet ‘Stop-AzureVM’.
VERBOSE: Importing cmdlet ‘Stop-AzureWebsite’.
VERBOSE: Importing cmdlet ‘Test-AzureName’.
VERBOSE: Importing cmdlet ‘Update-AzureDisk’.
VERBOSE: Importing cmdlet ‘Update-AzureVM’.
VERBOSE: Importing cmdlet ‘Update-AzureVMImage’.
PS C:\>

Windows Azure: Can we have a non-US outgoing IP Address on Azure?

The answer is NO. I am not sure the reason behind but it’s pretty funny for those who come from Amazon EC2.  Currently, there are several regions that you can choose when you create a new virtual machine on Windows Azure.

 

Azure Regions

You can checkout the IP range information on Azure data centers here ( link: Windows Azure Datacenter IP Ranges )  But creating a VM on non-US region doesn’t mean you will get the outgoing IP address from that region. It might be something new for some of us. I met with some Azure MVPs and MS folks who are promoting Azure so I shared this story with them but they asked me to share the screenshots so I am sharing them here..

Here is the steps (with screenshots) for my testing. (Note: I already deleted this test VM after capturing the screenshots. Don’t worry guys! )

1. I created a virtual machine in “West Europe” region.

West Europe Azure

2. Ok. It is created successfully.

VM on AzureI

3. But you see! I got US IP even I created my VM in Europe region.

Azure VM - Strange and werid outgoing IP

That’s but I am not an Azure expert so feel free to share if i miss out something or if you know the reason why Azure is using the US IP address range for outgoing traffic.

I also googled about it and here is what I found.

Kevin Williamson, a senior escalation engineer at Microsoft and work on the Windows Azure developer support team, replied on this post.

Every Azure IP address is registered to Microsoft in the US. There is no option for support to provide you with a “European IP address” since such a thing doesn’t exist in Azure. You should work with the other service provider to explore alternative options to requiring IP addresses registered to a European address since their strategy ultimately won’t work as more services move to shared cloud infrastructures.