0

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.
2
  • I assume you didn't edit the PublishSettings file. Can you publish via the right click Publish option in VS using this publish settings file? Have you tried redownloading the publish settings file? Commented May 4, 2016 at 17:07
  • Were you able to find a solution for this? Commented Sep 20, 2016 at 19:56

1 Answer 1

1

For anyone interested, I faced the same problem and found a solution.

The issue was that I was publishing from Visual Studio with a custom Publish Profile, instead of importing the Publish Profile from Azure.

By importing the Publish Profile from Azure, and plugging in the password in that document into /p:Password:, I was able to fix it

Sign up to request clarification or add additional context in comments.

1 Comment

That was my problem, thank you! For context, you can download the publish profile in you azure app "configuration page > deployment center > Manage publish profile"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.