I think this might still be an issue.
I am using v3.4.9 and having issues with deploying Web Apps. I suspect Octopus is retrieving the Publish Profiles from the wrong Resource Group.
I have 5 Resource Groups, one for each of our test environments and they are distinguishable by the number 1 to 5. Each resource group has a Web App and for consistency, the Web Apps have the same name.
After studying the deployment log, I can see that it has retrieved the publish profile for Test1, instead of the publish profile for Test3.
Deployment log
…
Deploying to Azure WebApp ‘WebApp(Staging)’ in Resource Group WebApp-Test3, using subscription-id '### SubscriptionId ###'
September 19th 2016 12:45:00Verbose
Retrieving publishing profile…
September 19th 2016 12:45:01Verbose
Retrieved publishing profile: URI: app-staging.scm.ase-test1.p.azurewebsites.net:443 UserName: $WebApp__Staging
September 19th 2016 12:45:01Verbose
Using ID ‘c6701672-0833-4e32-972a-f43d615fbe81’ for connections to the remote server.
September 19th 2016 12:45:01Verbose
Pre-authenticating to remote agent URL ‘https://app-staging.scm.ase-test1.p.azurewebsites.net/msdeploy.axd?site=WebApp(Staging)’ as ‘$WebApp__Staging’.
September 19th 2016 12:45:01Error
Microsoft.Web.Deployment.DeploymentAgentUnavailableException: Could not complete the request to remote agent URL ‘https://app-staging.scm.ase-test1.p.azurewebsites.net/msdeploy.axd?site=WebApp(Staging)’. —> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. —> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. —> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
September 19th 2016 12:45:01Error
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
September 19th 2016 12:45:01Error
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
September 19th 2016 12:45:01Error
— End of inner exception stack trace —
September 19th 2016 12:45:01Error
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
September 19th 2016 12:45:01Error
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
September 19th 2016 12:45:01Error
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
September 19th 2016 12:45:01Error
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
September 19th 2016 12:45:01Error
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
September 19th 2016 12:45:01Error
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
September 19th 2016 12:45:01Error
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
September 19th 2016 12:45:01Error
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
September 19th 2016 12:45:01Error
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
September 19th 2016 12:45:01Error
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
September 19th 2016 12:45:01Error
at System.Net.ConnectStream.WriteHeaders(Boolean async)
September 19th 2016 12:45:01Error
— End of inner exception stack trace —
September 19th 2016 12:45:01Error
at System.Net.HttpWebRequest.GetResponse()
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponseHelper(HttpWebRequest request)
September 19th 2016 12:45:01Error
— End of inner exception stack trace —
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponseHelper(HttpWebRequest request)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.AgentClientProvider.PerformHeadRequestHelper(Boolean getVersionInfo, Version& maximumSupportedVersion, Version& minimumSupportedVersion)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.AgentClientProvider…ctor(DeploymentProviderContext providerContext, DeploymentBaseContext baseContext, String serverVersion)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.DeploymentManager.CreateObjectPrivate(DeploymentProviderContext providerContext, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject, String serverVersion)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.DeploymentManager.CreateDestinationObject(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject, String serverVersion)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
September 19th 2016 12:45:01Error
at Calamari.Azure.Deployment.Conventions.AzureWebAppConvention.Install(RunningDeployment deployment) in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari.Azure\Deployment\Conventions\AzureWebAppConvention.cs:line 18
September 19th 2016 12:45:01Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
September 19th 2016 12:45:01Error
at Calamari.Deployment.ConventionProcessor.RunConventions() in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28
September 19th 2016 12:45:01Error
Running rollback conventions…
September 19th 2016 12:45:01Error
Microsoft.Web.Deployment.DeploymentAgentUnavailableException: Could not complete the request to remote agent URL ‘https://app-staging.scm.ase-test1.p.azurewebsites.net/msdeploy.axd?site=WebApp(Staging)’. —> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. —> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. —> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
September 19th 2016 12:45:01Error
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
September 19th 2016 12:45:01Error
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
September 19th 2016 12:45:01Error
— End of inner exception stack trace —
September 19th 2016 12:45:01Error
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
September 19th 2016 12:45:01Error
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
September 19th 2016 12:45:01Error
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
September 19th 2016 12:45:01Error
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
September 19th 2016 12:45:01Error
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
September 19th 2016 12:45:01Error
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
September 19th 2016 12:45:01Error
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
September 19th 2016 12:45:01Error
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
September 19th 2016 12:45:01Error
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
September 19th 2016 12:45:01Error
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
September 19th 2016 12:45:01Error
at System.Net.ConnectStream.WriteHeaders(Boolean async)
September 19th 2016 12:45:01Error
— End of inner exception stack trace —
September 19th 2016 12:45:01Error
at System.Net.HttpWebRequest.GetResponse()
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponseHelper(HttpWebRequest request)
September 19th 2016 12:45:01Error
— End of inner exception stack trace —
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponseHelper(HttpWebRequest request)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.AgentClientProvider.PerformHeadRequestHelper(Boolean getVersionInfo, Version& maximumSupportedVersion, Version& minimumSupportedVersion)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.AgentClientProvider…ctor(DeploymentProviderContext providerContext, DeploymentBaseContext baseContext, String serverVersion)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.DeploymentManager.CreateObjectPrivate(DeploymentProviderContext providerContext, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject, String serverVersion)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.DeploymentManager.CreateDestinationObject(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject, String serverVersion)
September 19th 2016 12:45:01Error
at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
September 19th 2016 12:45:01Error
at Calamari.Azure.Deployment.Conventions.AzureWebAppConvention.Install(RunningDeployment deployment) in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari.Azure\Deployment\Conventions\AzureWebAppConvention.cs:line 18
September 19th 2016 12:45:01Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
September 19th 2016 12:45:01Error
at Calamari.Deployment.ConventionProcessor.RunConventions() in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 50
September 19th 2016 12:45:01Error
at Calamari.Azure.Commands.DeployAzureWebCommand.Execute(String[] commandLineArguments) in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari.Azure\Commands\DeployAzureWebCommand.cs:line 86
September 19th 2016 12:45:01Error
at Calamari.Program.Execute(String[] args) in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Program.cs:line 38
September 19th 2016 12:45:02Fatal
The remote script failed with exit code 100
…