Azure CI/CD Pipeline deployment

AmaraCode LLC 261 Reputation points
2020-10-02T03:19:26.417+00:00

Greetings everyone and especially to @Ryan Hill for the help I've been receiving. I'm a late starter to the cloud world but a 25+ year veteran developer and I love all the Azure services but having trouble with a few things working together.

I have a repo setup in DevOps (not GitHub) and a build pipeline that is working. Doesn't mean it is correct but it has that nice green check-mark once it completes. Here is the yaml for that pipeline.:

trigger:  
  - master  
  
pool:  
  vmImage: "ubuntu-latest"  
  
steps:  
  - script: dotnet restore  
  - script: dotnet build --configuration Release  
    displayName: "dotnet build Release"  
  
  - task: DotNetCoreCLI@2  
    inputs:  
      command: "publish"  
      publishWebProjects: true  
      arguments: "--configuration Release --output $(Build.ArtifactStagingDirectory)"  
  
  - task: ArchiveFiles@2  
    inputs:  
      rootFolderOrFile: "$(Build.ArtifactStagingDirectory)"  
      includeRootFolder: false  
      archiveType: "zip"  
      archiveFile: "$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip"  
      replaceExistingArchive: true  

For the Release pipeline the screen looks like this. Note that the trigger is set to run on build.
29729-azure1.jpg

Next Artifacts looks like this:
29815-azure2.jpg

Next is Stage:
29659-azure3.jpg

The Agent information I did nothing with:
29660-azure4.jpg

Finally is the app service deploy.
29799-image.png

However note that when I look at the yaml of the App Service Deploy it seems to not be happy:

#Your build pipeline references an undefined variable named ‘Parameters.ConnectedServiceName’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972  
#Your build pipeline references an undefined variable named ‘Parameters.WebAppKind’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972  
#Your build pipeline references an undefined variable named ‘Parameters.WebAppName’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972  
#Your build pipeline references an undefined variable named ‘Parameters.StartupCommand’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972  
  
steps:  
- task: AzureRmWebAppDeployment@4  
  displayName: 'Deploy Azure App Service'  
  inputs:  
    azureSubscription: '$(Parameters.ConnectedServiceName)'  
    appType: '$(Parameters.WebAppKind)'  
    WebAppName: '$(Parameters.WebAppName)'  
    StartupCommand: '$(Parameters.StartupCommand)'  

What I'm not understanding is once the build pipeline completes and the trigger is kicked off in Release, how do I tell the app service deploy where to find the Release build? I'm sure there are variables or something that I'm missing.

Thanks for all the assistance.
Scott
@AmaraCode LLC

Community Center | Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2020-10-02T13:53:50.347+00:00

    Hi @AmaraCode LLC ,

    First off, welcome to the cloud! It can be confusing because there are some options when going to the cloud. Thanks for your posting your yaml and I took the opportunity obfuscating your sub'id in your 5th image; it was next to your subscription name. It's happened to me before and takes a keen eye.

    To answer your question, the parameters are defined on the stage, your 3rd screen shot.
    29922-image.png

    I'm assuming the snippet your pasted above is from View YAML button on the Deploy Azure App Service task. If so, then everything you've posted on your screen shots looks good. I can't explain the text other than to say its static text in case you decide to use the YAML outside of that pipeline. As long as you don't have any errors when viewing your App Service deploy task, you are good to go.

    To answer your 2nd question, the release pipeline will release what's in your artifacts "bucket", your _AmaraCode Website in your 1st screens shot.

    If you run your pipeline and get any errors, just paste them down below and we'll get it sorted out.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.