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
Feature: azd
template sources
#2573
Conversation
Wow - I love it! Love that you considered both ADE/non-ADE devs and also the possibility of local/remote pluggable sources (I am particularly excited about showing awesome-azd templates in the CLI). I really have no critical feedback here, direction here is great. Eventually, this will be another area that we can leverage the #2056 but that's a separate task (cc: @Austinauth as FYI) @gkulin as FYI for awesome-azd visibility. |
Have you considered using I wonder if having For the current azd-config style, users are allowed to either use |
Hey @wbreza this is looking super good! I have a few very minor suggestions.
Hitting return should default to the "No" selection. Thank you! |
The underlying configuration is stored in the azd configuration and just exposed through more specific command to help validate users template sources since multiple config values are required for template sources. Here is an example of the {
"alpha": {
"resourceGroupDeployments": "on",
"terraform": "on"
},
"defaults": {
"location": "eastus2",
"subscription": "faa080af-c1d8-40ad-9cce-e1a450ca5b57"
},
"template": {
"sources": {
"awesome-azd": {},
"org1": {
"key": "org1",
"location": "./templates.json",
"name": "My Org",
"type": "file"
},
"org2": {
"key": "org2",
"name": "Org 1",
"type": "file",
"location": "./templates.json"
}
}
}
} |
Moves templates to external templates.json file that can be linked to from other external systems like azd - Moves list of templates from inline within users.tsx to /static/templates.json - Moves template images to /static/templates/images Will allow templates json to be available @ https://aka.ms/awesome-azd/templates.json to be used within azd new template sources. Related to Azure/azure-dev#2573
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.
Awesome!! Thank you for doing this.
Can you add a note to the Changelog?
Can you also add a confirmation for azd config reset
to ask folks if they want to delete the template sources (in case there are some custom sources). Folks would hate to lose their sources on config reset
.
Or, if we don't want a confirmation, consider making azd confg reset
to exclude sources (when any)
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.
Awesome!
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.
Overall, this does seem to be a very generic feature that supports anyone hosting a template.Template[]
json file in some location. It also allows for user to opt-in to awesome-azd with azd template source add awesome-azd
. All this ends up changing the selection prompt that azd init
shows.
Some interesting questions as a result of genericism:
- When we enable
awesome-azd
, does that end up as user configuration (as it does now), or would we need to do something different? - I don't yet see a straightforward path to ADE support. It's likely that the request would need to be auth-ed with user context, which means that another kind of source type would need to be supported?
Overall, I see that adding awesome-azd support is indeed something good and don't have problems with landing this. My final 2cents here just for feedback: I'm not completely convinced that we necessarily need this level of extensibility and could see something more targeted to support awesome-azd
and ADE
(based on the use cases we've outlined in the PR), with a template manifest configuration to follow when we get more asks for it.
b963f08
to
3687579
Compare
3687579
to
a2b045f
Compare
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSIContainer
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
New Feature
Today when developers are first using
azd
theazd init
experience shows the user a small list of available templates. This list is manually curated and packaged at build time. To provide developers with a more robust experience developers and organizations may want to include additional templates as well as link to other template sources like AwsomeAzd.This PR introduces a new extensibility concept of configurable template sources and new/updated azd commands to manage template sources.
Use Case 1: Devs want to consume Awesome azd templates
AwsomeAzd is a great resource for developers, but today it is a multiple step process to discover and use the Awesome azd templates. Users must navigate to the Awesome azd site, find the template that matches their needs, copy the template repo url then use that repo url with
azd init -t <templates>
.Integrating
azd template list
directly with Awesome azd will enhance the discoverability of templates and make them available within theazd template list
experience as well as the defaultazd init
experienceEnable Awesome AZD
azd template source add awesome-azd
Use Case 2: Organizations want to provide a curated list of app/infra templates to their developers
Many organizations want to enable better platform engineering within their group and provide their developer teams with templates that they can use as starting points for developing new applications that leverage their organizations patterns, practices and have the required policies already in place.
Organizations can author a curated list of templates and developers can link to these templates through azd configuration to point to files or urls.
Add custom template source
azd template source add myorg --type url --location https://myorg/azd/templates.json
In the future Azure DevCenter will be another supported template source to link to DevCenter project catalogs for infra/app environment definitions.
Template Sources
default
: The resource backed default list of azd templatesfile
: Link to local/network paths that point to a JSON fileurl
: Link to an http/https addressable path to a JSON fileawesome-azd
: Automatically include all templates from AwsomeAzd.Note
Awesome Azd template source could be enabled by default when this feature is complete
Future Template Sources
ade
: Link to DevCenter project catalogsUpdated Commands
azd template list
: List templates across all configured template sourcesazd template list --source <name>
: List all templates for the specified template sourceazd config reset --force
: Defaults to prompt user for confirmation or pass the--force
-f
flag to skip confirmationNew Commands
azd template source list
: Lists currently configured template sourcesazd template source add <key>
: Adds a new template source into azd configuration--type, -t
: The type source type (file
|url
)--location, -l
: The template source location--displayName, -n
: The template source display name (optional, will usekey
if ommited.azd template source remove <key>
: Removes the template source with the specified keyNote
Configuration of template sources would be stored in
azd
config.json
fileExample Outputs
azd init
with custom template sourcesazd template list
azd template list --source myorg