# Cloud CI/CD: Verify target environment alias before continuing

**URL:** <https://forum.umbraco.com/t/cloud-ci-cd-verify-target-environment-alias-before-continuing/4368>\
**Category:** Questions\
**Tags:** umbraco-cloud\
**Created:** [July 2, 2025, 9:09am UTC](https://forum.umbraco.com/t/cloud-ci-cd-verify-target-environment-alias-before-continuing/4368 "2025-07-02T09:09:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skttl](https://forum.umbraco.com/user_avatar/forum.umbraco.com/skttl/32/260_2.png) [@skttl](https://forum.umbraco.com/u/skttl)\
**Post date:** [July 2, 2025, 9:09am UTC](https://forum.umbraco.com/t/cloud-ci-cd-verify-target-environment-alias-before-continuing/4368/1 "2025-07-02T09:09:00Z")

</div>

With the new CI/CD, I want to select the target environment based on the current branchname.

Eg. `cloud/live` goes to `live`, `cloud/dev` goes to `dev`, `cloud/my-new-flexible-environment goes` to `my-new-flexible-environment`.

I’ve modified the `azure-release-pipeline.yml` file to add this stage:

```yaml
  # resolve which environment to deploy to based on triggering branch
  - stage: resolveTarget
    displayName: Resolve Target Environment
    jobs:
      - job: setTargetEnvironment
        displayName: Set Target Environment Alias
        steps:
          - script: |
              echo "Triggering branch: $(Build.SourceBranchName)"
              echo "##vso[task.setvariable variable=targetEnvironment;isOutput=true]$(Build.SourceBranchName)"
            name: setTargetEnvironmentAlias
            displayName: Set Target Environment Alias

```

Is there any way I can verify that there actually is an environment with an alias matching my current branch name?
