Deploying multiple azure cloud services

Mads Dørup's Avatar

Mads Dørup

Feb 15, 2016 @ 11:06 PM

I have a problem where I have two azure cloud services in my solution that cannot seem to both get deployed. If I only try to deploy one or the other it works for both of them, but not for both of them together. The services are called SchedulerService and AsynchronousCrawlerWorker. This is the output I get in the console:

Uploading package "SchedulerService.cspkg" to Azure Blob storage "m1sportstorag3" as "packages/misports/1.0.3683/SchedulerService.cspkg"...OK
Upgrading existing deployment in Production environment...OK
Deploying using AzureCS provider
Deploying to Windows Azure Cloud Service
Deploying Azure Cloud Service package "AsynchronousCrawler.cspkg" to service gravecrawler
Uploading package "AsynchronousCrawler.cspkg" to Azure Blob storage "m1sportstorag3" as "packages/misports/1.0.3683/AsynchronousCrawler.cspkg"...OK
Upgrading existing deployment in Production environment...BadRequest : Validation Errors: Error validating the .cscfg file against the .csdef file. Severity:Error, message:No settings defined for role 'AsynchronousCrawlerWorker' declared in the service model.,Error validating the .cscfg file against the .csdef file. Severity:Error, message:No role named 'SchedulerWorker' found in the service definition file.

This is relevant part of my yml file:

before_package:
  - msbuild SchedulerService\SchedulerService.ccproj /t:Publish /p:PublishDir=%APPVEYOR_BUILD_FOLDER%\AzureArtifacts\SchedulerService /p:TargetProfile=Cloud /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /verbosity:quiet
  - msbuild AsynchronousCrawler\AsynchronousCrawler.ccproj /t:Publish /p:PublishDir=%APPVEYOR_BUILD_FOLDER%\AzureArtifacts\AsynchronousCrawler /p:TargetProfile=Cloud /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /verbosity:quiet
  - appveyor PushArtifact AzureArtifacts\SchedulerService\SchedulerService.cspkg
  - appveyor PushArtifact AzureArtifacts\SchedulerService\ServiceConfiguration.Cloud.cscfg -FileName SchedulerService.cscfg
  - appveyor PushArtifact AzureArtifacts\AsynchronousCrawler\AsynchronousCrawler.cspkg
  - appveyor PushArtifact AzureArtifacts\AsynchronousCrawler\ServiceConfiguration.Cloud.cscfg -FileName AsynchronousCrawler.cscfg

deploy:
  - provider: AzureCS
    subscription_id: [...]
    subscription_certificate: [...]
    storage_account_name: [...]
    storage_access_key: [...]
    service: [...]
    slot: Production
    deployment_label: $(appveyor_build_version)
    artifact: SchedulerService.cspkg
  - provider: AzureCS
    subscription_id: [...]
    subscription_certificate: [...]
    storage_account_name: [...]
    storage_access_key: [...]
    service: [...]
    slot: Production
    deployment_label: $(appveyor_build_version)
    artifact: AsynchronousCrawler.cspkg
  1. Support Staff 1 Posted by Feodor Fitsner on Feb 15, 2016 @ 11:14 PM

    Feodor Fitsner's Avatar

    Hi Mads,

    Can you drop a screenshot of what you have on "Artifacts" page of build results?

  2. 2 Posted by Mads Dørup on Feb 16, 2016 @ 08:34 AM

    Mads Dørup's Avatar

    Sure, here it is.

    By the way I tried to download these and inspect them and they seem to contain what they should. The RoleModel.xml inside the cspkg's looks like the csdef's from the projects in Visual Studio. Also, I tried to look at the cspkg's after they are uploaded to Azure Blob Storage. First, during deployment of SchedulerService, I see the SchedulerService.cspkg in the appropriate folder. I tried to download and inspect it and it seems good to me. Then, after the SchedulerService is deployed, its cspkg disappears and the AsynchronousCrawler.cspkg appears. I also inspected it and it also seems to be good.

    One thing I'm wondering is: What cscfg file is validated against during the second deployment? What is the powershell command that is run by appveyor? If I knew, I could try and reproduce the error on my own machine.

  3. Support Staff 3 Posted by Feodor Fitsner on Feb 16, 2016 @ 02:51 PM

    Feodor Fitsner's Avatar

    Thanks. In deployment settings you should also specify target_profile to use (i.e. cloud service configuration):

    deploy:
      - provider: AzureCS
        ...
        deployment_label: $(appveyor_build_version)
        artifact: SchedulerService.cspkg
        target_profile: SchedulerService.cscfg
      - provider: AzureCS
        ...
        deployment_label: $(appveyor_build_version)
        artifact: AsynchronousCrawler.cspkg
        target_profile: AsynchronousCrawler.cscfg
    
  4. Ilya Finkelshteyn closed this discussion on Aug 25, 2018 @ 02:04 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