I have a simple application which processes messages in an Azure Queue.
public static void ProcessQueueMessage([QueueTrigger("myqueue")] string message, TextWriter log)
{
Console.WriteLine("QGot: " + message);
Console.WriteLine(string.Format("{0}: Completed: {1}", DateTime.Now, message));
}
I would like to deploy this application multiple times to the same WebApp. I've been following the steps here to try and deploy the console app as a WebJob.
I added the following webjobs.props to my console app project and tried to deploy with msbuild but am having some authentication problems:
<!--
<ManagementCertificate>MII...o=</ManagementCertificate>
<SubscriptionId>e0...af</SubscriptionId>
-->
<PublishSettingsPath>C:\Users\m\Downloads\VisualStudioPremiumwithMSDN-5-3-2016-credentials.publishsettings</PublishSettingsPath>
<SubscriptionId>e0...af</SubscriptionId>
</PropertyGroup>
</Target>
msbuild command:
C:\Users\m\Projects\ConsoleApp>msbuild ConsoleApp.csproj /p:PublishProfile="MultipleWebJobTestApp - Web Deploy" /p:DeployOnBuild=true
Error:
MSDeployPublish:
Start Web Deploy Publish the Application/package to https://multiplewebjobtestapp.scm.azurewebsites.net/msdeploy.axd?site=MultipleWebJobTestApp ...
Starting Web deployment task from source: manifest(C:\Users\m\Projects\ConsoleApp\obj\Debug\Package\DummyProvisioningApp.SourceManifest.xml) to Destination: auto().
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4283,5): msdeploy error ERROR_USER_UNAUTHORIZED: Web deployment task failed. (Connected to the remote computer ("multiplewebjobtestapp.scm.azurewebsites.net") usi
ng the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more
at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.) [C:\Users\m\Projects\ConsoleApp\ConsoleApp.csproj]
Publish failed to deploy.
Done Building Project "C:\Users\m\Projects\ConsoleApp\ConsoleApp.csproj" (default targets) -- FAILED.