Build configurations for automatic packaging Azure web job

Madhu Babu's Avatar

Madhu Babu

01 Feb, 2017 06:09 AM

Hi,

Am able to build my web job (console application). Build is successful but no artifacts generated.

And this is how my yml file look like. Kindly let me know if anything to change

version: 1.0.{build}
before_build:
- cmd: nuget restore BrightSkool.EmailWebJob.sln
build: 
  verbosity: minimal
artifacts: 
  - path: BrightSkool.EmailWebJob
    name: BrightSkoolwebjob
    type: zip

deploy:
  - provider: AzureWebJob
    website: bsnotification
    username: $bsnotification
    password:
      secure: dTv8ubx5ziYDswQqZmF
    artifact: BrightSkoolwebjob
  1. 1 Posted by Ilya Finkelshte... on 01 Feb, 2017 11:59 PM

    Ilya Finkelshteyn's Avatar

    I see nothing wrong with your configuration, however usually files which need to be deployed are in bin\$(configuration) sub folder for the project folder. I assume that BrightSkool.EmailWebJob is in the root of project folder and you can do dir BrightSkool.EmailWebJob during the build.

    Please send us build log to understand the problem more.

  2. 2 Posted by Madhu Babu on 02 Feb, 2017 06:06 AM

    Madhu Babu's Avatar

    Hi Ilya,

    I managed to zip the artifacts by pointing artifacts path to debug folder in the yml configurations. Below is the updated yml

    version: 1.0.{build}
    before_build:
    - cmd: nuget restore BrightSkool.EmailWebJob.sln
    build: 
      verbosity: minimal
    artifacts:
      # This will zip up all files in the bin\debug or bin\release folder.
      - path: BrightSkool.EmailWebJob\bin\Debug
        name: BrightSkoolEmail 
        type: zip
    
    deploy:
      - provider: AzureWebJob 
        website: bsnotification
        username: $bsnotification
        password: 
        secure: dTv8ubx5ziYDswQqZmF
        artifact: BrightSkoolEmail
    

    Now am facing different issue. Even though i give proper credentials of web job.

    401 - Unauthorized: Access is denied due to invalid credentials.
    You do not have permission to view this directory or page using the credentials that you supplied.
    

    attached my build log for your reference. Thank you

    • Madhu
  3. 3 Posted by Ilya Finkelshte... on 02 Feb, 2017 06:38 PM

    Ilya Finkelshteyn's Avatar

    Hi Madhu,

    With web jobs you can use credentials from publishing profile you download, or deployment credentials you set on Azure portal (more details about those credentials here https://github.com/projectkudu/kudu/wiki/Deployment-credentials)

    From what I see your username ($bsnotification) looks like it is from publishing profile. But passwords provided in publishing profile are much longer, and after AppVeyor encrypted them, they are even longer. Do if you decide to use credentials from publishing profile, you need to take password from it (file should look like bsnotification.azurewebsites.net.PublishSettings), encrypt it with https://ci.appveyor.com/tools/encrypt and then put to YAML.

    Or you can use Deployment (user level) credentials you can setup in Azure portal. In this case name is what you decide to do, not $bsnotification. By the way advantage of using deployment credentials is that you can use them with deployment slots.

    Ilya.

  4. 4 Posted by Madhu Babu on 22 Feb, 2017 12:29 PM

    Madhu Babu's Avatar

    Hi Ilya,

    I used the credentials from the downloaded publishing profile, Only thing is i just typed the part of it in this post, since i don't want to expose the password.

    Next thing, i encrypted the password downloaded from publishing profile using the provided link and placed the password.

    No luck, still same issue

    401 - Unauthorized: Access is denied due to invalid credentials.
    You do not have permission to view this directory or page using the credentials that you supplied.
    

    attached my latest yml and build logs, for your reference

    Regards,
    Madhu

  5. 5 Posted by Ilya Finkelshte... on 22 Feb, 2017 08:41 PM

    Ilya Finkelshteyn's Avatar

    Hi Madhu,

    I believe that problem is indentation. Add 2 more spaces before secure and check if this works. YAML format is very sensitive to indentation, and if you are not sure you can always try to do basic settings in UI, then use Export YAML menu.

    Ilya.

  6. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:15 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac