-
Couldn't load subscription status.
- Fork 260
Update pipeline config - provider parameters #5143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ckwards compatibility
…ter fixing the parameters mapping to env vars resolution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - but i would recommend adding some unit tests to validate some of the new behavior. I see we have the e2e snapshot tests but a few more unit tests might enable us to more quickly iterate on future changes.
|
Once this is done, we need to manage state in the CI pipeline (github, ado) and we need to make it such that when you add new parameters that they don't overwrite old ones. |
Repoman Generation ResultsRepoman pushed changes to remotes for the following projects: Project: todo-csharp-cosmos-sqlRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-csharp-cosmos-sql -b pr/5143View Changes | Compare Changes Project: todo-csharp-sql-swa-funcRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-csharp-sql-swa-func -b pr/5143View Changes | Compare Changes Project: todo-csharp-sqlRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-csharp-sql -b pr/5143View Changes | Compare Changes Project: todo-java-mongo-acaRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-java-mongo-aca -b pr/5143View Changes | Compare Changes Project: todo-java-mongoRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-java-mongo -b pr/5143View Changes | Compare Changes Project: todo-java-postgresql-terraformRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-java-postgresql-terraform -b pr/5143View Changes | Compare Changes Project: todo-nodejs-mongo-acaRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-aca -b pr/5143View Changes | Compare Changes Project: todo-nodejs-mongo-aksRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-aks -b pr/5143View Changes | Compare Changes Project: todo-nodejs-mongo-swa-funcRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-swa-func -b pr/5143View Changes | Compare Changes Project: todo-nodejs-mongoRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo -b pr/5143View Changes | Compare Changes Project: todo-nodejs-mongo-terraformRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-terraform -b pr/5143View Changes | Compare Changes Project: todo-python-mongo-acaRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo-aca -b pr/5143View Changes | Compare Changes Project: todo-python-mongo-swa-funcRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo-swa-func -b pr/5143View Changes | Compare Changes Project: todo-python-mongoRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo -b pr/5143View Changes | Compare Changes Project: todo-python-mongo-terraformRemote: azure-samples-stagingBranch: pr/5143You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo-terraform -b pr/5143View Changes | Compare Changes |
|
/check-enforcer override |
|
overriding checks for todo-templates b/c it has a different issue. This PR does not affect todo-templates direct functionality and its pipeline functionality is not tested in workflows |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
|
@vhvb1989 , what's the env var name pattern? |
That would be api-secret -> to snake upper case -> API_SECRET Yes. You would get the same by having |
|
Where is this documented? Also, should we use the azd env set AZURE_SOME_KEY $(VALUE_FROM_PIPELINE_LIBRARY)
azd env get-values
azd provision --no-prompt - task: AzureCLI@2
displayName: Provision Infrastructure
inputs:
azureSubscription: ${{ variables.AzureServiceConnection }}
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
dotnet ef --version
cd $(Build.SourcesDirectory)/src/Project.AppHost
azd env new $(AZURE_ENV_NAME)
azd env set AZURE_SOME_KEY $(VALUE_FROM_PIPELINE_LIBRARY)
azd env get-values
azd provision --no-prompt
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
AZURE_LOCATION: 'westeurope'
AZURE_SOME_KEY: $(VALUE_FROM_PIPELINE_LIBRARY)
I'm awaiting your reply. Tom Update: Parameter resource could not be used because configuration key 'Parameters:some-key' is missing and the Parameter has no default value. in our Program.cs //rest omitted for brevity
IResourceBuilder<ParameterResource> someKey = builder.AddParameter("some-key");after running In our main.bicep file: @description('Some test parameter')
param some_key stringIn our main.parameters.json: (.. rest omitted for brevity)
"some_key ": {
"value": "${AZURE_SOME_KEY}"
}, |
|
@Fazer01 , you can see the latest doc here: https://learn.microsoft.com/dotnet/aspire/whats-new/dotnet-aspire-9.3#-azd-major-improvements-to-cicd-for-aspire-apps You don't need to call In your example above, - task: AzureCLI@2
displayName: Provision Infrastructure
inputs:
azureSubscription: ${{ variables.AzureServiceConnection }}
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
azd provision --no-prompt
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
AZURE_LOCATION: $(AZURE_LOCATION)
AZURE_SOME_KEY: $(AZURE_SOME_KEY) |
|
Alright! Thanks for the extensive response @vhvb1989! We haven't upgraded to .NET Aspire 9.3 yet, so that's what I'm going to do first. We have created our own pipeline definition, not using Update The pipeline error is in the following form:
|
This change introduces a feature for pipeline config called
provider parameters.This feature allows infrastructure providers like bicep, to generate a list of parameters required for provisioning the infrastructure definition.
Then,
pipeline configgets this information and uses it to generate the pipeline definition and to automatically know what variables and secrets must be set for running provision on CI/CD.This feature enhance the current approach that requires people to manually define the required variables and secrets for the pipeline in azure.yaml. If the infrastructure provider can infer this information from the IaC, the user will no longer need to manually worry about creating the configuration.
For the bicep-provider, for example, the required variables and secrets for CI are inferred from the parameters file.
By using this strategy, AZD no longer requires the
AZD_INITIAL_ENVIRONMENT_CONFIGto smuggle local prompts to CI. As long as there is one ENV VAR mapping to a parameter, AZD will know what variable or secret to create in CI and the value for it.This change also improves the experience for Aspire, where the IaC is automatically generated and a mapping to ENV VARS is always generated.
Note: All previous configuration will still be supported, but after this change, AZD will use the new strategy.