tag:help.appveyor.com,2012-11-13:/discussions/problems/977-deploy-web-job-using-appveyorAppVeyor: Discussion 2018-08-25T02:02:51Ztag:help.appveyor.com,2012-11-13:Comment/351304852015-09-14T21:37:18Z2015-09-14T21:37:18ZDeploy Web Job using Appveyor<div><p>I am hopeful. If my understanding is correct, it looks like a
simple PUT request that will (may) create<br>
the schedule.job file with the contents from the request’s
body: {“schedule": “0 */2 * * * *”}.</p>
<p>The API supporting the following 6 fields: (second, minute,
hour, day, month, day of the week).</p>
<p>I have the cmdlet roughed in BUT No cron validation, nor have I
tested it. I currently don’t have a triggered job deployed to
test against at this time.</p>
<p>I’ll commit the new additions later today</p>
<p>The cmdlet will works as follows:<br>
Set-KuduTriggeredSchedule -Website {siteName} -UserName {userName}
-Password {password} -JobName {jobName} -Schedule “0 */2 * *
* *”</p>
<p>Cheers.</p>
<p>Added Start-KuduContiniousJob, Stop-KuduContiniousJob,
Get-KuduContiniousJob as well.</p></div>kevintag:help.appveyor.com,2012-11-13:Comment/351304852015-09-14T23:27:32Z2015-09-14T23:27:32ZDeploy Web Job using Appveyor<div><p>My initial assumptions was wrong, I ended up needing to create
the file schedule.job and then up load it using<br>
the same API Endpoint (PUT /api/triggeredwebjobs/{job
name}/settings)</p>
<p>under the hood of the cmdlet is just</p>
<p>Invoke-RestMethod -Uri $url -Headers $headers -InFile $file
-Method Put -ContentType "application/json";</p>
<p>it is working, I have lightly tested it. note the API has no
return on success.</p>
<p>Any input is welcome, especially on error handling and
validation on quartz cron.</p></div>kevintag:help.appveyor.com,2012-11-13:Comment/351304852015-09-15T23:47:16Z2015-09-15T23:47:16ZDeploy Web Job using Appveyor<div><p>Nice! Now we have all missing pieces to make Web Jobs
deployment. Thank you very much for putting this together!</p>
<p>I've added a link to this discussion to the issue: <a href="https://github.com/appveyor/ci/issues/277">https://github.com/appveyor/ci/issues/277</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/351304852015-10-12T14:55:18Z2015-10-12T14:55:19ZDeploy Web Job using Appveyor<div><p>Hello!</p>
<p>Do you guys have an ETA on your support for this?</p></div>Øyvind Vallandtag:help.appveyor.com,2012-11-13:Comment/351304852015-11-25T17:10:32Z2015-11-25T17:10:32ZDeploy Web Job using Appveyor<div><p>Any news on support for this? It would be nice to get an update,
even if it is to say "not yet."</p></div>Øyvind Vallandtag:help.appveyor.com,2012-11-13:Comment/351304852015-11-25T18:09:37Z2015-11-25T18:09:37ZDeploy Web Job using Appveyor<div><p>Oyvind,</p>
<p>I have created a powershell module <a href="https://github.com/deepcovelabs/PsKudu">PsKudu</a> which might
help. It is still a work in progress. We use it in our
deployments.</p>
<pre>
<code>Publish-KuduWebjob `
-WebsiteName $env:webdeploy_site `
-Username $env:webdeploy_username `
-Password $env:webdeploy_Pwd `
-FilePath "$env:APPVEYOR_BUILD_FOLDER\Worker.zip" `
-JobName "AwebJobWorker" `
-RunCommand "Worker.exe";</code>
</pre>
<p>website, Username, password at the ones in your azure
PublishProfileSettings files.</p></div>kevintag:help.appveyor.com,2012-11-13:Comment/351304852015-12-10T21:30:32Z2015-12-10T21:30:33ZDeploy Web Job using Appveyor<div><p>I am seeing the appveyor.pubxml file not found error when trying
to build a solution that includes a web api and web job project. Is
this still an active open issue?</p>
<p>What is the current/best work around to get a build environment
working? I am trying to get the web api to be built as an artifact
so it can be used to deploy both the web api and web job using web
deploy.</p></div>Michael Sierstag:help.appveyor.com,2012-11-13:Comment/351304852015-12-10T22:18:33Z2015-12-10T22:24:58ZDeploy Web Job using Appveyor<div><p>Micheal,</p>
<p>Sounds like you are using the deploy provider
<code>WebDeploy</code> for webjobs. It been awhile since I used
that method but I vaguely recall needing to create an
<code>appveyor.pubxml</code> in the projects properties folder. I
think I created mine to match the provider settings just in
case.</p>
<p>The <code>WebDeploy</code> provider did not work for us in the
end for webjobs.</p>
<p>Currently we package each project in a <code>zip</code> file and
then deploy them with MsDeploy (API and SPA) and PsKudu (KuduAPI)
for webjobs, but previously, we use <code>WebDeploy</code> provider
to deploy our API and SPA then <code>after_deploy</code> webjobs
were deployed with <code>Invoke-MSBuild</code> (MsBuild powershell
wrapper ):<br></p>
<pre>
<code>Invoke-MSBuild -projectsToBuild "C:\Development\project\Server.Worker\Server.Worker.csproj" <code>
-visualStudioVersion 12.0</code>
-DeployOnBuild $true <code>
-properties @{'_DestinationType'='AzureWebSite'}</code>
-publishProfile "C:\Development\project\Server.Worker\Properties\PublishProfiles\azure.pubxml" `
-password "$env:mpCicdPwd"</code>
</pre>
my azure.pubxml
<pre>
<code><?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://{your azure site}.azurewebsites.net</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
<MSDeployServiceURL>{publishSettings site}.scm.azurewebsites.net:443</MSDeployServiceURL>
<DeployIisAppPath>{publishSettings sitename}</DeployIisAppPath>
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<UserName>{publishSettings UserName}</UserName>
<_SavePWD>True</_SavePWD>
<_DestinationType>AzureWebSite</_DestinationType>
<PublishDatabaseSettings>
{your app settings}
</PublishDatabaseSettings>
</PropertyGroup>
<ItemGroup>
<MSDeployParameterValue Include="$(DeployParameterPrefix)DefaultConnection-Web.config Connection String">
<ParameterValue>{some params}</ParameterValue>
</MSDeployParameterValue>
</ItemGroup>
<ItemGroup>
<_ConnectionStringsToInsert Include="DefaultConnection" />
</ItemGroup>
</Project></code>
</pre>
<p>Hope this somewhat helpful.</p></div>kevintag:help.appveyor.com,2012-11-13:Comment/351304852015-12-10T23:03:21Z2015-12-10T23:03:21ZDeploy Web Job using Appveyor<div><p>Thanks, Kevin!</p>
<p>Just to add that in order to use AppVeyor's automatic packaging
you can add <code>appveyor.pubxml</code> publishing profile to Web
Job project with the following contents:</p>
<pre>
<code><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>$(APPVEYOR_BUILD_FOLDER)\MyWebJob</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project></code>
</pre>
<p>You can specify a path where job will be published in
<code>publishUrl</code>.</p></div>Feodor Fitsner