Skip to content
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

Additional Output for Azure Pipelines #978

Closed
HSNVC opened this issue Oct 8, 2024 · 2 comments
Closed

Additional Output for Azure Pipelines #978

HSNVC opened this issue Oct 8, 2024 · 2 comments

Comments

@HSNVC
Copy link

HSNVC commented Oct 8, 2024

I'm using AzureAppConfiguration@8 in an Azure Pipeline (YML) to retrieve settings that I can then apply to an App Service using the AzureAppServiceSettings@1 task.

The output of the AzureAppConfiguration@8 task is as below and the key-values are stored as ENV variables as expected.
'7' key-values were retrieved from Azure App Configuration.

I then have to write additional logic via PowerShell to create a JSON that can be passed to the AzureAppServiceSettings@1 task, I can build that logic because I know what those key-values are, but if my colleagues were to add additional values to the store I'd have to then define them in the PowerShell script too.

I have tried this route, I had the idea of keeping the prefix instead of trimming it to help identify them amongst the other env variables, but then trimming the prefix using PowerShell when it's either in a hashtable or JSON becomes messy.

This could be seen as similar to an existing issue #729 for some additional logs on the Push task, in an ideal world there would be an output variable that would provide the key names only that could then be used in downstream tasks.

@zhenlan
Copy link
Contributor

zhenlan commented Oct 9, 2024

@HSNVC the AzureAppConfiguration task is for users to consume data from App Configuration in the native way of Azure pipelines, so it pulls key-values and makes them available as pipeline variables (accessible as environment variables). In your case, you don't really consume them as pipeline variables. You want to generate a JSON file that you can feed to the AzureAppServiceSettings@1 task. In this case, you can use Azure CLI to export data from App Configuration to a JSON file directly. See the following document for more information:

https://learn.microsoft.com/en-us/azure/azure-app-configuration/scripts/cli-export

@HSNVC
Copy link
Author

HSNVC commented Oct 9, 2024

@zhenlan appreciate you pointing me in the right direction, I think I probably looked at and disregarded the CLI export too quickly as I didn't want to create additional files, without realising I could just capture the data into a variable to pass to the next task. I've got this working now with relatively little code so will close this issue, thanks for your help.

@HSNVC HSNVC closed this as completed Oct 9, 2024
@zhenlan zhenlan self-assigned this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants