© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•13mo ago•
29 replies
essenbee

✅ Can't Deploy .NET Aspire application using azd in Azure DevOps Pipeline

I am having a very frustrating problem deploying my .NET Aspire application system using
azd deploy
azd deploy
in Azure DevOps. I searched the issues and I tried these steps that I found, but to no avail:

- create a pipeline variable called
AZD_INITIAL_ENVIRONMENT_CONFIG
AZD_INITIAL_ENVIRONMENT_CONFIG

- copy the contents of the
.azure/<env_name>/config.json
.azure/<env_name>/config.json
file into it
- reference the variable in the YAML, like this:

  - task: AzureCLI@2
    displayName: Deploy Service Layer Core
    inputs:
      azureSubscription: azconnection
      scriptType: bash
      scriptLocation: inlineScript
      keepAzSessionActive: true
      inlineScript: |
        cd $(Build.SourcesDirectory)/ServiceLayer.AppHost;
        ls -la;
        azd deploy --no-prompt --environment $(AZURE_ENV_NAME);
    env:
      AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
      AZURE_ENV_NAME: $(AZURE_ENV_NAME)
      AZURE_LOCATION: $(AZURE_LOCATION)
      AZD_INITIAL_ENVIRONMENT_CONFIG: $(AZD_INITIAL_ENVIRONMENT_CONFIG)
  - task: AzureCLI@2
    displayName: Deploy Service Layer Core
    inputs:
      azureSubscription: azconnection
      scriptType: bash
      scriptLocation: inlineScript
      keepAzSessionActive: true
      inlineScript: |
        cd $(Build.SourcesDirectory)/ServiceLayer.AppHost;
        ls -la;
        azd deploy --no-prompt --environment $(AZURE_ENV_NAME);
    env:
      AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
      AZURE_ENV_NAME: $(AZURE_ENV_NAME)
      AZURE_LOCATION: $(AZURE_LOCATION)
      AZD_INITIAL_ENVIRONMENT_CONFIG: $(AZD_INITIAL_ENVIRONMENT_CONFIG)


However, I still get the same error when the pipeline runs
azd deploy
azd deploy
:

ERROR: failed deploying service 'account-service': failed executing template file: template: manifest template:27:19: executing "manifest template" at <securedParameter "CacheConnection">: error calling securedParameter: parameter CacheConnection not found
ERROR: failed deploying service 'account-service': failed executing template file: template: manifest template:27:19: executing "manifest template" at <securedParameter "CacheConnection">: error calling securedParameter: parameter CacheConnection not found


I even added a step to echo out the contents of the environment variable, and all looks fine with it. I also tried creating the AZDO pipeline using
azd pipeline config --provider azdo
azd pipeline config --provider azdo
. It created the AZD_INITIAL_ENVIRONMENT_CONFIG variable for me, but I still get the same error . Deploying from the command line works fine btw.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

[Azure Devops] Deploy Pipeline
C#CC# / help
2y ago
✅ Aspire .NET deploy into k8s
C#CC# / help
3y ago