You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a .NET Aspire application that I can provision and deploy into Azure using azd provision and azd deploy when I run these commands locally on the command line. However, these commands fail when run as part of an Azure DevOps Pipeline.
I created the Azure Devops Pipeline in the following manner:
ran azd pipeline config --provider azdo
entered secrets and other params when prompted
updated the azure_dev.yml file to the following and committed:
# Run when commits are pushed to master
trigger: none
pool:
vmImage: ubuntu-latest
steps:
# setup-azd@0 needs to be manually installed in your organization
# if you can't install it, you can use the below bash script to install azd
# and remove this step
- task: setup-azd@0
displayName: Install azd
# azd delegate auth to az to use service connection with AzureCLI@2
- pwsh: |
azd config set auth.useAzCliAuth "true"
displayName: Configure AZD to Use AZ CLI Authentication.
# DEBUG: print AZD_INITIAL_ENVIRONMENT_CONFIG for debugging
- task: PowerShell@2
displayName: Show var for debugging
inputs:
targetType: "inline"
script: |
Write-Host ($env:var1).substring(0,1);
Write-Host ($env:var1).substring(1);
env:
var1: $(AZD_INITIAL_ENVIRONMENT_CONFIG)
# Install .NET 9.0 SDK
- task: UseDotNet@2
displayName: Install .NET 9.0 SDK
inputs:
packageType: 'sdk'
version: '9.0.x'
installationPath: $(Agent.ToolsDirectory)/dotnet
# Restore dependencies
- task: DotNetCoreCLI@2
displayName: Restore dependencies
inputs:
command: "restore"
projects: "./ServiceLayerCore.sln"
feedsToUse: "config"
nugetConfigPath: "./NuGet.Config"
# Build the project
- task: DotNetCoreCLI@2
displayName: Build Service Layer Core
inputs:
command: "build"
projects: "./ServiceLayerCore.sln"
arguments: "--configuration Release"
- task: AzureCLI@2
displayName: Provision Infrastructure
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
keepAzSessionActive: true
inlineScript: |
cd $(Build.SourcesDirectory)/ServiceLayer.AppHost;
azd provision --no-prompt
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 Application
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
keepAzSessionActive: true
inlineScript: |
cd $(Build.SourcesDirectory)/ServiceLayer.AppHost;
azd deploy --no-prompt;
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)
When I run the pipeline, the Provision step fails with the error:
ERROR: initializing provisioning manager: prompting for value: no default response for prompt 'Enter a value for the 'AADB2CClientId' infrastructure parameter:'
However, the pipeline step DEBUG: print AZD_INITIAL_ENVIRONMENT_CONFIG for debugging printed out the value of the AZD_INITIAL_ENVIRONMENT_CONFIG and it definitely contains the infrastructure parameters e.g.
No matter what I do, the pipeline always fails with the same error. It looks like azd is ignoring the values in the environment variable.
Any help on this would be gratefully received as this is currently blocking any progress I can make productionizing my application.
The text was updated successfully, but these errors were encountered:
@essenbee2 , did you run azd pipeline config from within the root of your solution? or from within the AppHost folder? (is your azure.yaml file located on the root of your repo next to the .github folder?)
I ran azd init and azd pipeline config from within the ServiceLayer.AppHost folder. azure.yaml is in that folder. However, the .git file is in the root of the solution.
@vhvb1989 Thank you so much for the clue you provided! Running azd init and azd pipeline config from the root of the solution fixes the issue! I am so relieved to get this working.
I am going to re-open this issue and follow up about the issue when running azd pipeline config from within the AppHost folder. That case should work just the same as running from the root of the repo.
azd version 1.11.1 (commit ae08ceb)
I have a .NET Aspire application that I can provision and deploy into Azure using
azd provision
andazd deploy
when I run these commands locally on the command line. However, these commands fail when run as part of an Azure DevOps Pipeline.I created the Azure Devops Pipeline in the following manner:
azd pipeline config --provider azdo
azure_dev.yml
file to the following and committed:When I run the pipeline, the Provision step fails with the error:
ERROR: initializing provisioning manager: prompting for value: no default response for prompt 'Enter a value for the 'AADB2CClientId' infrastructure parameter:'
However, the pipeline step
DEBUG: print AZD_INITIAL_ENVIRONMENT_CONFIG for debugging
printed out the value of theAZD_INITIAL_ENVIRONMENT_CONFIG
and it definitely contains the infrastructure parameters e.g.No matter what I do, the pipeline always fails with the same error. It looks like
azd
is ignoring the values in the environment variable.Any help on this would be gratefully received as this is currently blocking any progress I can make productionizing my application.
The text was updated successfully, but these errors were encountered: