Windows Azure Deployment – Problem and Solution #2

The post is the second post of my “Windows Azure Deployment – Problem and Solution” series. You also read the first post in this link.

Contents

Problem: Issue with multiple Azure subscriptions with same name

Duplicated Subscription Name

The code below is for getting the azure deployment to determine whether we need to publish new package or update the existing page.


$subscription = "[Your Subscription Name]"
$service = "[Your Azure Service Name]"
$slot = "staging" #staging or production
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg"
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"

Write-Output "Running Azure Imports"
Import-Module "C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\*.psd1"
Import-AzurePublishSettingsFile "C:\TeamCity\[PSFileName].publishsettings"
Set-AzureSubscription -CurrentStorageAccount $service -SubscriptionName $subscription

function Publish(){
 $deployment = Get-AzureDeployment -ServiceName $service -Slot $slot -ErrorVariable a -ErrorAction silentlycontinue

But I got the following error at the line where I call Get-AzureDeployment.

Error Message

VERBOSE: 3:26:54 PM – Begin Operation: Get-AzureDeployment
Get-AzureDeployment : “An exception occurred when calling the ServiceManagement API. HTTP Status Code: 404. Service
Management Error Code: ResourceNotFound. Message: No deployments were found.. Operation Tracking ID:
b27b43c1bf5a47fb97167ede7e364206.”
At C:\BuildAgent\work\e02c76f07d491d1d\scripts\azure_deploy.ps1:57 char:27
+ $completeDeployment = Get-AzureDeployment -ServiceName $service -Slot $slot
+ ~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureDeployment], ServiceManagementClientException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.HostedServices.GetAzureDeploymentCom
mand

VERBOSE: 3:26:54 PM – Completed Operation: Get-AzureDeployment

Solution

I tried deploying the project from Visual Studio a couple of times and sometimes, the publish wizard can’t detect the service that I created so I assumed that both Azure powershell cmdlet and the publish wizard from VS got the same issue. then I realized that it is because I have multiple subscription that have the same name.. Surprisingly, the most of Azure API are based on “subscriptionName ” instead of the name.. ( man.. there are a lot of funny stuffs in Azure but I can see that there are a lot of improvements being done during this year.. )

The solution for this issue is that you need to set the id when you call Set-AzureSubscription API. The updated code will be looked like that below.


$subscriptionId = "[Your Subscription Id]"
$subscriptionName = "[Your Subscription Name]"

$service = "[Your Azure Service Name]"
$slot = "staging" #staging or production
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg"
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"

Write-Output "Running Azure Imports"
Import-Module "C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\*.psd1"
Import-AzurePublishSettingsFile "C:\TeamCity\[PSFileName].publishsettings"
Set-AzureSubscription -CurrentStorageAccount $service -SubscriptionName $subscriptionName -SubscriptionId $subscriptionId

function Publish(){
$deployment = Get-AzureDeployment -ServiceName $service -Slot $slot -ErrorVariable a -ErrorAction silentlycontinue

Problem: CurrentStorageAccount is not set

data servers

The error message that I got is “Current storage account is not set”. It’s a bit misleading because as you can see in the code below (esp: last line), I did set the current storage but why did I get this message?

Error Message

New-AzureDeployment : CurrentStorageAccount is not set. Use Set-AzureSubscription subname -CurrentStorageAccount
storageaccount to set it.
At C:\BuildAgent\work\e02c76f07d491d1d\scripts\azure_deploy.ps1:55 char:15
+ $opstat = New-AzureDeployment -Slot $slot -Package $package -Configuration $ …
+ ~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureDeployment], ArgumentException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.HostedServices.NewAzureDeploymentCom
mand

Solution

The problem was that I have many subscription accounts and I created the storage account in wrong subscription account. The solution is just to create new storage account in correct subscription account from Azure web console.

Problem: Authentication and Certificate Issues

Security

The error message that I got is “Current storage account is not set”. It’s a bit misleading because as you can see in the code below (esp: last line), I did set the current storage but why did I get this message?

Error Messages

New-AzureDeployment : “An exception occurred when calling the ServiceManagement API. HTTP Status Code: 403. Service
Management Error Code: AuthenticationFailed. Message: The server failed to authenticate the request. Verify that the
certificate is valid and is associated with this subscription.. Operation Tracking ID: <NONE>.”
At line:1 char:1
+ New-AzureDeployment -Slot “staging” -Package “MyProject.Azure\bin\Release\app.publish …
+ ~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureDeployment], ServiceManagementClientException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.HostedServices.NewAzureDeploymentCommand

New-AzureDeployment : “An exception occurred when calling the ServiceManagement API. HTTP Status Code: 400. Service
Management Error Code: BadRequest. Message: The certificate with thumbprint 426bed136649263b9a154f5fdc1f2707a6ecf482
was not found.. Operation Tracking ID: f5925a7eb5a44dcf8c56c6e950cc8229.”
At C:\BuildAgent\work\e02c76f07d491d1d\Scripts\azure_deploy.ps1:62 char:15
+ $opstat = New-AzureDeployment -Slot $slot -Package $package -Configuration $ …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureDeployment], ServiceManagementClientException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.HostedServices.NewAzureDeploymentCom
mand

Solution #1

  • Add-AzureCertificate -serviceName <CLOUDSERVICENAME> -certToDeploy (get-item cert:\CurrentUser\MY\<THUMBPRINT>)
  • Add-AzureCertificate -serviceName hivewebrole -certToDeploy (get-item “cert:\Local Machine\Personal\426BED136649263B9A154F5FDC1F2707A6ECF482”)

And need to pass the certificate information from powershell script. I will show you the updated script later.

Solution #2

It doesn’t matter which solution you choose. You will still need to pass the cert from your script.

Here is the updated script that contains the code for passing the cert.


$thumbprint = &quot;[The tumbprint of your certificate.]&quot;
$myCert = Get-Item cert:\\CurrentUser\My\$thumbprint

$subscriptionId = &quot;[Your Subscription Id]&quot;
$subscriptionName = &quot;[Your Subscription Name]&quot;

$service = &quot;[Your Azure Service Name]&quot;
$slot = &quot;staging&quot; #staging or production
$package = &quot;[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg&quot;
$configuration = &quot;[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg&quot;
$timeStampFormat = &quot;g&quot;
$deploymentLabel = &quot;ContinuousDeploy to $service v%build.number%&quot;

Write-Output &quot;Running Azure Imports&quot;
Import-Module &quot;C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\*.psd1&quot;
Import-AzurePublishSettingsFile &quot;C:\TeamCity\[PSFileName].publishsettings&quot;

Set-AzureSubscription -CurrentStorageAccount $service -SubscriptionName $subscriptionName -SubscriptionId $subscriptionId -Certificate $myCert

Write-Output &quot;Set-AzureSubscription&quot;

function Publish(){
$deployment = Get-AzureDeployment -ServiceName $service -Slot $slot -ErrorVariable a -ErrorAction silentlycontinue

Additional, you might get the error below when you import the Azure publish setting file after making changes in certificate.

PS C:\Windows\system32> Import-AzurePublishSettingsFile “C:\Users\root\Downloads\Visual Studio Ultimate with MSDN-Windows
Azure MSDN – Visual Studio Ultimate-BizSpark–credentials.publishsettings”
Import-AzurePublishSettingsFile : No certificate was found in the certificate store with thumbprint
EB3E353EE50CB344F246D0D975557CBAB1C38494
At line:1 char:1
+ Import-AzurePublishSettingsFile “C:\Users\root\Downloads\Visual Studio Ultimate w …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Import-AzurePublishSettingsFile], ArgumentException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.Subscription.ImportAzurePublishSettingsCommand

The solution for that you need to do either one of them that I listed below.

  • Close and re-open the powershell  — OR —
  • Delete all files under C:\Users\[User]\AppData\Roaming\Windows Azure Powershell,   — OR —
  • Restart the server

Problem: Server Busy

DDos attack

( Yes. I captured the screenshot of “DDoS Attack Visualization” video from Logstalgia  because it’s pretty cool. You should go and check out the project as well. )

But no. Windows Azure wasn’t under DDOS attack.

Error Message

Set-AzureDeployment : “An exception occurred when calling the ServiceManagement API. HTTP Status Code: 503. Servi
Management Error Code: ServerBusy. Message: The server is currently unavailable to receive requests. Please retry
request.. Operation Tracking ID: 9b4dfd5616b34c87bfaf6f808a9d22be.”
At C:\BuildAgent\work\e02c76f07d491d1d\Scripts\azure_deploy.ps1:77 char:22
+ $setdeployment = Set-AzureDeployment -Upgrade -Slot $slot -Package $package …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureDeployment], ServiceManagementClientException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.HostedServices.SetAzureDeploymemand

Solution

The only solution is that you need to wait a bit and try to deploy it again.

I think that’s pretty much it.. I haven’t played around with SDK 2.2 yet.. I will leave this series open and if I got something new then I will post it here again..

Thanks!

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 &quot;Running Azure Imports&quot;
Import-Module &quot;C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\*.psd1&quot;

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 &quot;Running Azure Imports&quot;
Import-Module &quot;C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1&quot;

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.

 

WebDeploy 3 – Error in publishing website to Amazon EC2

Here is the error that I got when I publish website from Azure VM to Amazon EC2 VM. I am using the following MSBuild command to do the deployment and I got Web Deploy 3.0 installed on EC2 VM.

/p:Configuration=Release /p:OutputPath=bin /p:VisualStudioVersion=11.0 /p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MsDeployServiceUrl=https://my-super-cool-server/msdeploy.axd /p:AllowUntrustedCertificate=True /p:DeployIisAppPath=YourWebSiteInstanceName /p:MSDeployPublishMethod=WMSVC /p:username=root /p:password=SuperComplexRootPassword

Error Message [VSMSDeploy] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4196, 5): error ERROR_DESTINATION_NOT_REACHABLE: Web deployment task failed. (Could not connect to the remote computer (my-super-cool-server””). On the remote computer, make sure that Web Deploy is installed and that the required process (“Web Management Service”) is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.) [14:58:46][MyWebsite\MyWebsite.csproj.teamcity] Project MyWebsite\MyWebsite.csproj.teamcity failed. VSMSDeploy-update Solution As this post is not about how to use WebDeploy to deploy website, I am not going to write the detailed steps here. If you are new to using webdeploy, please read this post “Automating Deployment with Microsoft Web Deploy” The reason that I got this error is that the default for Web Management Service is not enabled by default in EC2. The solution is to enable the port 80 (which you might already enabled it for your website) for Web Deployment Agent and port 8172 for Web Management Service in both the server’s firewall and EC2 Security Group.

  • Web Deployment Agent Service : Port 80
  • Web Management Service : Port 8172

EC2 Security Group Hope it helps for those who are using MS deploy for publishing website on IIS. Reference:

Migrating the existing blog to Google App Engine PHP Runtime is not that simple

Google App Engine

Google announced that Google App Engine PHP Runtime now available to everyone on Oct 8, 2013. As I am having a lot of problems with service uptime on Dreamhost that I am currently using, I decided to give a try.

Here is the list of things that I have done so far.

  • I created a Cloud Console application for my blog on Google Cloud platform.
  • Under my console app, I created a MySQL database (Cloud SQL) that , Busket (Cloud Storage). I need to enable the billing which requires the credit card information before creating the database.
  • I also upgraded the Google App for Business, which will cost you $5 per month, so that I can add the custom domain.
  •  I followed “Running WordPress in App Engine” document to install SDK, create the config files and manage to deploy it from my local machine to Google app engine.

So far so good but the problems come when I start the migration.

Google App Engine for WordPress Plugin

Google released an official plugin for wordpress but all it does is to remove the nice user experiences provided by wordpress team. For example:  The sub-menu for Plugin is gone after activating the “Google App Engine for WordPress” plugin.

Google App Engine WordPress Plugin

And you can’t find/install any theme in “Appreance\Themes” page.

Wordpress Theme In Google App Engine

I understand that Google wants us to install the theme or plugin in local machine and deploy it to Cloud service but why? We don’t have Google SDK on each and every machine. We, wordpress users, are able to search and install the plugin/theme since long time back and its one of the coolest feature provided by wordpress team.

No direct access to public from Google App Engine

This makes a lot of things failed for wordpress users. Akismet is the most popular plugin provided by official wordpress team for us to fight the spammers but now, that plugin doesn’t work. I am not sure how many plugin will not work on Google App Engine.

It’s the one of the reason why Google’s plugin doesn’t allows user to search/install new theme or plugin directly from the blog.

Akismet

Memcached

Activating “Memcached plugin” causes this error below.

Fatal error: Cannot redeclare wp_cache_add() (previously declared in /base/data/home/apps/s~ms-blog/dd/wordpress/wp-includes/cache.php:24) in /base/data/home/apps/s~ms-blog/dd/wordpress/wp-content/plugins/memcached/object-cache.php on line 22

I saw some solutions in google search but come on! you guys already know that every single person who are using wordpress and activate this plugin will get this error. why don’t you fix it before you release? or, it would be nice if you can provide the official solution in readme or somewhere. Ok. it’s not an official plugin from Google but you guys can mention is in your document “Running WordPress in App Engine“.

Memcached

Cost

Ok! I deployed my blog a couple of times but Google is charging me “0.31” USD already. As you can see in the chart, there are a few requests. It’s because Google cron job is doing the call every 2 hours as the requirement of Google App. I think it’s going to cost me a lot more compared to Dreamhost but of course, Google might be able to provide a better up-time so I have to see how much it’s going to cost me.

Google App Engine WordPress Bill

I am still having problem with mapping my custom domain in Google App but I will post about it later.

I understand that Google App engine for PHP is still in early stage. but if you think you can migrate your blog to Google just like that then you need to think twice. Initially, I thought I should be able to migrate my blog within one or two days. But with all those broken plugin and etc, its gonna take a good amount of time to get the full working version of my blog even I used to use PHP language before.

Please feel free to share your experience if you are also migrating your existing blog to Google App engine.

Thanks!