Forum Discussion
Identifying a pipeline type
I need to identify weather a azure pipeline is deploying an application or just infrastructure of some kind. I need to do this by parsing Azure releases API's json. There are no naming conventions, tags, or naming of release definition's name or anything which identifies the release as a infra or application release. Is there any key in releases API or deployments API or can I expand some parameter which can help me identify this with certainity?
1 Reply
No Direct Key for "Type" unfortunately, neither the Releases API nor the Deployments API includes a direct key like "type": "application" or "type": "infrastructure". However, you can infer the pipeline’s purpose by inspecting a few strategic fields:
1. Artifacts Section
Look at the artifacts array in the release definition:
• If the artifact is from a build pipeline, it likely relates to application deployment.
• If the artifact is from a repository (e.g., ARM templates, Bicep files, Terraform), it’s likely infrastructure."artifacts": [ { "type": "Build", "definitionReference": { "project": { "id": "..." }, "definition": { "id": "123", "name": "WebApp-CI" } } } ]
2. Tasks and Deployment Steps
Expand the environments > deployPhases > workflowTasks section:
• Look for tasks like AzureRmWebAppDeployment, DotNetCoreCLI, or PublishBuildArtifacts → Application
• Look for tasks like AzureResourceManagerTemplateDeployment, TerraformCLI, or BicepDeploy → Infrastructure
3. Release Variables or Parameters
Sometimes developers embed hints in variables or releaseParameters. You can scan for keywords like:
• "resourceGroup", "templateFile", "infra" → Infrastructure
• "appName", "slotName", "packagePath" → Application
4. Deployment Target
Check the environment or deploymentGroup:
• If it targets a VM or Kubernetes cluster, it might lean infrastructure.
• If it targets an App Service or Function App, it’s likely application.