diff --git a/cli/azd/.github/CODE_OF_CONDUCT.md b/cli/azd/.github/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000000..f9ba8cf65f3
--- /dev/null
+++ b/cli/azd/.github/CODE_OF_CONDUCT.md
@@ -0,0 +1,9 @@
+# Microsoft Open Source Code of Conduct
+
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
+
+Resources:
+
+- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
+- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
+- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
diff --git a/cli/azd/.github/ISSUE_TEMPLATE.md b/cli/azd/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 00000000000..15c7f602286
--- /dev/null
+++ b/cli/azd/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,33 @@
+
+> Please provide us with the following information:
+> ---------------------------------------------------------------
+
+### This issue is for a: (mark with an `x`)
+```
+- [ ] bug report -> please search issues before submitting
+- [ ] feature request
+- [ ] documentation issue or request
+- [ ] regression (a behavior that used to work and stopped in a new release)
+```
+
+### Minimal steps to reproduce
+>
+
+### Any log messages given by the failure
+>
+
+### Expected/desired behavior
+>
+
+### OS and Version?
+> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
+
+### Versions
+>
+
+### Mention any other details that might be useful
+
+> ---------------------------------------------------------------
+> Thanks! We'll be in touch soon.
diff --git a/cli/azd/.github/PULL_REQUEST_TEMPLATE.md b/cli/azd/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 00000000000..ab05e292b7f
--- /dev/null
+++ b/cli/azd/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,45 @@
+## Purpose
+
+* ...
+
+## Does this introduce a breaking change?
+
+```
+[ ] Yes
+[ ] No
+```
+
+## Pull Request Type
+What kind of change does this Pull Request introduce?
+
+
+```
+[ ] Bugfix
+[ ] Feature
+[ ] Code style update (formatting, local variables)
+[ ] Refactoring (no functional changes, no api changes)
+[ ] Documentation content changes
+[ ] Other... Please describe:
+```
+
+## How to Test
+* Get the code
+
+```
+git clone [repo-address]
+cd [repo-name]
+git checkout [branch-name]
+npm install
+```
+
+* Test the code
+
+```
+```
+
+## What to Check
+Verify that the following are valid
+* ...
+
+## Other Information
+
\ No newline at end of file
diff --git a/cli/azd/.gitignore b/cli/azd/.gitignore
index 03fed358981..2814b2c36c6 100644
--- a/cli/azd/.gitignore
+++ b/cli/azd/.gitignore
@@ -1,11 +1,401 @@
-/azd
-azd.exe
-azd-record
-azd-record.exe
-build
-resource.syso
-versioninfo.json
-azd.sln
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
-**/target
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+# but not Directory.Build.rsp, as it configures directory-level build defaults
+!Directory.Build.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.tlog
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
+*.vbp
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+*.dsw
+*.dsp
+
+# Visual Studio 6 technical files
+*.ncb
+*.aps
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# Visual Studio History (VSHistory) files
+.vshistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# JetBrains Rider
+*.sln.iml
+.azure
diff --git a/cli/azd/.mvn/wrapper/MavenWrapperDownloader.java b/cli/azd/.mvn/wrapper/MavenWrapperDownloader.java
new file mode 100644
index 00000000000..89964d141fb
--- /dev/null
+++ b/cli/azd/.mvn/wrapper/MavenWrapperDownloader.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0'
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+ private static final String WRAPPER_VERSION = "0.5.6";
+ /**
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+ */
+ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+ /**
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+ * use instead of the default one.
+ */
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+ ".mvn/wrapper/maven-wrapper.properties";
+
+ /**
+ * Path where the maven-wrapper.jar will be saved to.
+ */
+ private static final String MAVEN_WRAPPER_JAR_PATH =
+ ".mvn/wrapper/maven-wrapper.jar";
+
+ /**
+ * Name of the property which should be used to override the default download url for the wrapper.
+ */
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+ public static void main(String args[]) {
+ System.out.println("- Downloader started");
+ File baseDirectory = new File(args[0]);
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
+ // wrapperUrl parameter.
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+ String url = DEFAULT_DOWNLOAD_URL;
+ if(mavenWrapperPropertyFile.exists()) {
+ FileInputStream mavenWrapperPropertyFileInputStream = null;
+ try {
+ mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+ Properties mavenWrapperProperties = new Properties();
+ mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+ } catch (IOException e) {
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+ } finally {
+ try {
+ if(mavenWrapperPropertyFileInputStream != null) {
+ mavenWrapperPropertyFileInputStream.close();
+ }
+ } catch (IOException e) {
+ // Ignore ...
+ }
+ }
+ }
+ System.out.println("- Downloading from: " + url);
+
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+ if(!outputFile.getParentFile().exists()) {
+ if(!outputFile.getParentFile().mkdirs()) {
+ System.out.println(
+ "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+ }
+ }
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+ try {
+ downloadFileFromURL(url, outputFile);
+ System.out.println("Done");
+ System.exit(0);
+ } catch (Throwable e) {
+ System.out.println("- Error downloading");
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+ if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+ String username = System.getenv("MVNW_USERNAME");
+ char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+ Authenticator.setDefault(new Authenticator() {
+ @Override
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(username, password);
+ }
+ });
+ }
+ URL website = new URL(urlString);
+ ReadableByteChannel rbc;
+ rbc = Channels.newChannel(website.openStream());
+ FileOutputStream fos = new FileOutputStream(destination);
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+ fos.close();
+ rbc.close();
+ }
+
+}
diff --git a/cli/azd/.mvn/wrapper/maven-wrapper.jar b/cli/azd/.mvn/wrapper/maven-wrapper.jar
new file mode 100644
index 00000000000..2cc7d4a55c0
Binary files /dev/null and b/cli/azd/.mvn/wrapper/maven-wrapper.jar differ
diff --git a/cli/azd/.mvn/wrapper/maven-wrapper.properties b/cli/azd/.mvn/wrapper/maven-wrapper.properties
new file mode 100644
index 00000000000..4be2349493b
--- /dev/null
+++ b/cli/azd/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1,3 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
+
diff --git a/cli/azd/.springjavaformatconfig b/cli/azd/.springjavaformatconfig
new file mode 100644
index 00000000000..12643781ce9
--- /dev/null
+++ b/cli/azd/.springjavaformatconfig
@@ -0,0 +1 @@
+java-baseline=8
\ No newline at end of file
diff --git a/cli/azd/CHANGELOG.md b/cli/azd/CHANGELOG.md
index 7137d1ee11c..982475272da 100644
--- a/cli/azd/CHANGELOG.md
+++ b/cli/azd/CHANGELOG.md
@@ -1,1235 +1,13 @@
-# Release History
+## [project-title] Changelog
-## 1.18.0-beta.1 (Unreleased)
+
+# x.y.z (yyyy-mm-dd)
-### Features Added
+*Features*
+* ...
-### Breaking Changes
+*Bug Fixes*
+* ...
-### Bugs Fixed
-
-### Other Changes
-
-## 1.17.2 (2025-06-23)
-
-### Bugs Fixed
-
-- [[5391]](https://github.com/Azure/azure-dev/pull/5391) Fix getting principal type when using legacy auth (az auth).
-
-## 1.17.1 (2025-06-20)
-
-### Features Added
-
-- [[5203]](https://github.com/Azure/azure-dev/pull/5203) Make sure to always use latest static-web-apps CLI npm package.
-- [[5270]](https://github.com/Azure/azure-dev/pull/5270) Add support for Terraform+OIDC in pipeline config.
-- [[5280]](https://github.com/Azure/azure-dev/pull/5280) Combine "Create a minimal project" with "Scan current directory" option and add --minimal flag.
-- [[5285]](https://github.com/Azure/azure-dev/pull/5285) [compose + CI/CD] - Introduce AZURE_PRINCIPAL_TYPE to conditionally set user-only role assignments
-- [[4942]](https://github.com/Azure/azure-dev/pull/4942) Update env set to accept multiple key-value pairs.
-- [[4969]](https://github.com/Azure/azure-dev/pull/4969) Case-insensitive sorting for subscriptions.
-
-### Bugs Fixed
-
-- [[5386]](https://github.com/Azure/azure-dev/pull/5386) Fix regression, prompting for bool or int without default.
-
-## 1.17.0 (2025-06-05)
-
-### Features Added
-
-- [[5249]](https://github.com/Azure/azure-dev/pull/5249) Add support for deploying a single service in .NET Aspire projects via vs-server.
-- [[5157]](https://github.com/Azure/azure-dev/pull/5157) Update `azd add` integration with AI Foundry to use simplified 1RP setup with all models under a single AI Services account.
-- [[5214]](https://github.com/Azure/azure-dev/pull/5214) Add Linux to Homebrew formulae. Thanks @heaths for the contribution!
-- [[5204]](https://github.com/Azure/azure-dev/pull/5204) Add login guard middleware to auto-prompt for user login in key commands if unauthenticated.
-- [[5248]](https://github.com/Azure/azure-dev/pull/5248) `azd pipeline config` support for configuring CI/CD using Managed Identities.
-- [[5200]](https://github.com/Azure/azure-dev/pull/5200) Update Bicep param prompting to support a default selected option, allowing azd to auto-select it with `--no-prompt`.
-- [[5242]](https://github.com/Azure/azure-dev/pull/5242) Promote `azd add` and composability features to Beta.
- - Remove `alpha.compose` alpha feature.
- - Use `azd add` to add Azure components to your project. `azd add` does not currently support Aspire projects or most azd templates.
- - Use `azd show ` or `azd show ` to view details about a specific resource.
-- [[5260]](https://github.com/Azure/azure-dev/pull/5260) Rename `azd infra synth` to `azd infra generate` (`azd infra gen` for short) and promote to Beta.
- - Remove `alpha.infraSynth` alpha feature.
- - `azd infra synth` will continue to work as an alias of `azd infra generate`, but users are encouraged to use the new command names as `azd infra synth` may be removed in a future release.
-
-### Breaking Changes
-
-- [[5242]](https://github.com/Azure/azure-dev/pull/5242), [[5260]](https://github.com/Azure/azure-dev/pull/5260) When initializing from app code or minimal project, the `infra/` folder is no longer generated. azd now manages infrastructure in-memory by default, but you can still generate IaC to disk to manually manage your infrastructure using `azd infra generate` (or `azd infra gen` for short).
-- [[5242]](https://github.com/Azure/azure-dev/pull/5242) When initializing from app code or minimal project, environment initialization is now deferred to provision time (e.g. `azd up`), unless the `--environment ` flag is passed to the `azd init` command or the `AZURE_ENV_NAME` environment variable is set.
-- [[5157]](https://github.com/Azure/azure-dev/pull/5157) AI Services models added through `azd add` require an updated version of the Azure AI Foundry SDK client library that supports project endpoints (`AZURE_AI_PROJECT_ENDPOINT=https://.services.ai.azure.com/api/projects/`) instead of project connection strings (`AZURE_AI_PROJECT_CONNECTION_STRING=eastus.api.azureml.ms;;;`).
-
-### Bugs Fixed
-
-- [[5187]](https://github.com/Azure/azure-dev/pull/5187) Improve UX of `azd init` by displaying neutral message when user declines initializing in a non-empty directory.
-- [[5255]](https://github.com/Azure/azure-dev/pull/5255) Fix vs-server crash when telemetry is disabled.
-- [[5199]](https://github.com/Azure/azure-dev/pull/5199) Avoid unnecessary ACR login for Aspire projects using only public images.
-- [[5246]](https://github.com/Azure/azure-dev/pull/5246) Remove explicit ACA Environment Contributor role assignment for Aspire projects. Thanks @eerhardt for the contribution!
-
-### Other Changes
-
-- [[5261]](https://github.com/Azure/azure-dev/pull/5261) Update dependencies to mitigate CVE-2025-30204.
-- [[5245]](https://github.com/Azure/azure-dev/pull/5245) Update Bicep CLI to v0.36.1.
-- [[5212]](https://github.com/Azure/azure-dev/pull/5212) Update changelog casing in developer extension release pipelines.
-- [[5209]](https://github.com/Azure/azure-dev/pull/5209) Deprecate internal registry extension in favor of azd developer extension.
-
-## 1.16.1 (2025-05-15)
-
-### Bugs Fixed
-
-- [[5198]](https://github.com/Azure/azure-dev/issues/5198) Fixes error messages surfaced to users that contain internal implementation details.
-
-### Other Changes
-
-## 1.16.0 (2025-05-14)
-
-### Features Added
-- [[5173]](https://github.com/Azure/azure-dev/pull/5173) `azd show` support for Azure App Service.
-- [[5158]](https://github.com/Azure/azure-dev/pull/5158) Configure Azure AI Foundry hub to use identity-based storage access for compose.
-- [[5143]](https://github.com/Azure/azure-dev/pull/5143), [[5183]](https://github.com/Azure/azure-dev/pull/5183), [[5185]](https://github.com/Azure/azure-dev/pull/5185) Update `azd pipeline config` to auto-detect required variables and secrets from infra provider parameters.
-- [[5190]](https://github.com/Azure/azure-dev/pull/5190) Add interactive controls for managing existing GitHub Actions variables and secrets during `azd pipeline config`.
-- [[5155]](https://github.com/Azure/azure-dev/pull/5155) Adds support for nested extension namespaces
-
-### Bugs Fixed
-
-- [[5176]](https://github.com/Azure/azure-dev/pull/5176) Prevent same resource being added under 'uses' multiple times with `azd add`.
-- [[5176]](https://github.com/Azure/azure-dev/pull/5176) Fix `azd add` preview for MySQL and Postgres and other UX improvements.
-- [[5192]](https://github.com/Azure/azure-dev/pull/5192) Fix Bicep generation for compose projects with implicit Key Vault dependency.
-
-### Other Changes
-
-- [[5194]](https://github.com/Azure/azure-dev/pull/5194) Reorganize `azd` help text with updated command sections (Getting started, Azure resources, Settings, Beta, Alpha, Extensions).
-- [[5189]](https://github.com/Azure/azure-dev/pull/5189) Clarify in environment prompt that the name must be unique.
-- [[5187]](https://github.com/Azure/azure-dev/pull/5187) Improve confirmation UX when declining to initialize template in non-empty directory.
-- [[5159]](https://github.com/Azure/azure-dev/pull/5159) Update Aspire detection message to not specifically mention ACA.
-- [[5138]](https://github.com/Azure/azure-dev/pull/5138) Update Bicep CLI to v0.35.1.
-
-## 1.15.1 (2025-05-07)
-
-### Bugs Fixed
-
-- [[5151]](https://github.com/Azure/azure-dev/issues/5151) Fix bicep provisioning failure with array parameters in `main.parameters.json`. Thanks @Mstiekema for the contribution!
-
-## 1.15.0 (2025-05-01)
-
-### Features Added
-
-- [[5073]](https://github.com/Azure/azure-dev/pull/5073) Support generate CI definition for alpha feature composability mode.
-- [[5077]](https://github.com/Azure/azure-dev/pull/5077) `azd add` support for Azure App Service (Node and Python).
-
-### Bugs Fixed
-
-- [[5061]](https://github.com/Azure/azure-dev/pull/5061) Fix location no longer prompted error for targetScope resource group.
-- [[5117]](https://github.com/Azure/azure-dev/pull/5117) Fix template list filter empty result due to `awesome-azd` source breaking change.
-- [[5102]](https://github.com/Azure/azure-dev/pull/5102) Fix AKS cluster deployment with Microsoft Entra ID authentication and Azure RBAC enabled. Thanks @pauldotyu for the contribution!
-
-### Other Changes
-
-- [[4885]](https://github.com/Azure/azure-dev/pull/4885) Pack build to support multi-module projects. Thanks @haoozhang for the contribution!
-- [[5081]](https://github.com/Azure/azure-dev/pull/5081) Bump up dependency to fix component governance alert.
-
-## 1.14.0 (2025-04-02)
-
-### Features Added
-
-- [[4939]](https://github.com/Azure/azure-dev/pull/4939) Automatically load environment values from root .env on `azd init`.
-- [[4939]](https://github.com/Azure/azure-dev/pull/4939) Introduce `AZD_ALLOW_NON_EMPTY_FOLDER` variable that bypasses warning about initializing template in non-empty directory.
-- [[4977]](https://github.com/Azure/azure-dev/pull/4977), [[4995]](https://github.com/Azure/azure-dev/pull/4995) New `azd init --up` flag that runs `azd up` after initializing from a template. Thanks @LianwMS for the contribution!
-- [[4943]](https://github.com/Azure/azure-dev/pull/4943) `azd add` support for existing resources (AI models, AI Search, Key Vault, Event Hubs, Service Bus, Storage).
-- [[4931]](https://github.com/Azure/azure-dev/pull/4931) `azd add` support for Azure AI Search.
-- [[4914]](https://github.com/Azure/azure-dev/pull/4914) `azd show` support for all resources supported by `azd add`.
-- [[4874]](https://github.com/Azure/azure-dev/pull/4874) Provide shortcuts for `azd env set-secrets` to directly use Key Vault created with `azd add`.
-- [[4957]](https://github.com/Azure/azure-dev/pull/4957), [[4959]](https://github.com/Azure/azure-dev/pull/4959), [[4979]](https://github.com/Azure/azure-dev/pull/4979), [[4999]](https://github.com/Azure/azure-dev/pull/4999), [[5008]](https://github.com/Azure/azure-dev/pull/5008) Support .NET Aspire 9.1.
-- [[4953]](https://github.com/Azure/azure-dev/pull/4953) Support array of model usage names for quota validation.
-- [[5010]](https://github.com/Azure/azure-dev/pull/5010) Support model usage name metadata for main `location` Bicep parameter.
-
-### Bugs Fixed
-
-- [[4966]](https://github.com/Azure/azure-dev/pull/4966) Fix `AZURE_OPENAI_ENDPOINT` not showing in `azd add` preview.
-- [[4561]](https://github.com/Azure/azure-dev/pull/4561) Fix `azd up -e ` so it uses the specified environment.
-- [[4960]](https://github.com/Azure/azure-dev/pull/4960) Fix simplified init failing to provision with detected databases and `alpha.compose` off.
-- [[4929]](https://github.com/Azure/azure-dev/pull/4929), [[5010]](https://github.com/Azure/azure-dev/pull/5010) Improve location and quota validation for Azure AI Services resources.
-
-### Other Changes
-
-- [[4794]](https://github.com/Azure/azure-dev/pull/4794) Upgrade to Go 1.24.
-- [[4960]](https://github.com/Azure/azure-dev/pull/4960) Use Standard SKU for Azure Service Bus.
-- [[4960]](https://github.com/Azure/azure-dev/pull/4960) Remove passing host settings through `main.parameters.json`.
-- [[4972]](https://github.com/Azure/azure-dev/pull/4972) Remove unused core Bicep modules.
-
-## 1.13.2 (2025-03-25)
-
-### Bugs Fixed
-
-- [[4937]](https://github.com/Azure/azure-dev/pull/4937) Security fix (GHSA-qxp5-gwg8-xv66). golang.org/x/net.
-
-## 1.13.1 (2025-03-11)
-
-### Features Added
-
-- [[4886]](https://github.com/Azure/azure-dev/pull/4886) Improve database dependency detection for Maven projects. Thanks @rujche for the contribution!
-
-### Bugs Fixed
-
-- [[4917]](https://github.com/Azure/azure-dev/pull/4917) Allow Linux App Service deployments to resume on 500 deployment status response.
-- [[4924]](https://github.com/Azure/azure-dev/pull/4924) Fix cast error when parsing usage name Bicep param metadata.
-
-## 1.13.0 (2025-03-06)
-
-### Features Added
-
-- [[4841]](https://github.com/Azure/azure-dev/pull/4841) `azd add` support for Azure AI Services models and Azure AI Foundry resources. Also add intelligent filtering support for location Bicep parameter based on AI model quota and usage info.
-- [[4780]](https://github.com/Azure/azure-dev/pull/4780) `azd add` support for Azure Cosmos DB. Thanks @saragluna for the contribution!
-- [[4783]](https://github.com/Azure/azure-dev/pull/4783) `azd add` support for Azure Database for MySQL. Thanks @saragluna for the contribution!
-- [[4842]](https://github.com/Azure/azure-dev/pull/4842) `azd add` support for Azure Key Vault.
-- [[4743]](https://github.com/Azure/azure-dev/pull/4743) `azd add` support for Azure Service Bus and Azure Event Hubs.
-- [[4765]](https://github.com/Azure/azure-dev/pull/4765) `azd add` support for Azure Storage (blob service).
-- [[4859]](https://github.com/Azure/azure-dev/pull/4859) Add `docker` language type to support containerized applications written in languages like Go without native support in azd.
-- [[4770]](https://github.com/Azure/azure-dev/pull/4770) Add support for environment secrets in pipeline configuration.
-- [[4547]](https://github.com/Azure/azure-dev/pull/4547) Add warning to `azd env set` when setting a key that already exists in a different casing.
-- [[4872]](https://github.com/Azure/azure-dev/pull/4872) Improve error message when running `pwsh` hooks without PowerShell 7 installed.
-
-### Bugs Fixed
-
-- [[4806]](https://github.com/Azure/azure-dev/pull/4806) Fix error retrieving effective POM for multi-module Maven projects. Thanks @rujche for the contribution!
-- [[4773]](https://github.com/Azure/azure-dev/pull/4773) Fix error packaging app code with directory symlinks.
-- [[4807]](https://github.com/Azure/azure-dev/pull/4807) Fix YAML parsing to better handle nested structures.
-- [[4847]](https://github.com/Azure/azure-dev/pull/4847) Improve color consistency to align with design guidelines.
-- [[4801]](https://github.com/Azure/azure-dev/pull/4801), [[4782]](https://github.com/Azure/azure-dev/pull/4782) Fix Aspire bind mounts on Windows paths outside of C: drive and add support for single file binding.
-- [[4789]](https://github.com/Azure/azure-dev/pull/4789) Fix container entrypoints not being respected for Aspire.
-- [[4849]](https://github.com/Azure/azure-dev/pull/4849) Restrict password generation character set to be compatible with Aspire.
-- [[4850]](https://github.com/Azure/azure-dev/pull/4850) Support `azd init --from-code --no-prompt` in CI to initialize and deploy Aspire apps without prompting.
-
-### Other Changes
-
-- [[3976]](https://github.com/Azure/azure-dev/pull/3976) Convert azd templates to use AVM instead of infra/core.
-- [[4797]](https://github.com/Azure/azure-dev/pull/4797) Add GitHub Copilot for Azure telemetry user agent type.
-- [[4784]](https://github.com/Azure/azure-dev/pull/4784) Correct links in `CONTRIBUTING.md`. Thanks @Lunatico9 for the contribution!
-
-## 1.12.0 (2025-02-05)
-
-### Features Added
-
-- [[4729]](https://github.com/Azure/azure-dev/pull/4729) Improve Maven project detection using effective POM. Thanks @rujche for the contribution!
-- [[4517]](https://github.com/Azure/azure-dev/pull/4517) New `azd env set-secret` command and hooks support for using Azure Key Vault secrets in an azd environment. [Learn more](docs/using-environment-secrets.md).
-- [[2856]](https://github.com/Azure/azure-dev/pull/2856) Show identity info after successful `azd auth login` and new `azd auth login --check-status` standalone command. Thanks @john0isaac for the contribution!
-- [[4595]](https://github.com/Azure/azure-dev/pull/4595) Support custom `pwsh` arguments in hook definitions. Thanks @Yionse for the contribution!
-
-### Bugs Fixed
-
-- [[4692]](https://github.com/Azure/azure-dev/pull/4692) Fix `azd add` database failing in projects without a host.
-- [[4684]](https://github.com/Azure/azure-dev/pull/4684) Support Bicep `@sealed()` decorator on user defined types.
- - Fix `azd provision` failing to deploy Bicep containing `sealed()` decorators on user defined types.
-- [[4722]](https://github.com/Azure/azure-dev/pull/4722) Support nullable Bicep params.
- - Fix `azd provision` prompting for nullable Bicep params.
-- [[4744]](https://github.com/Azure/azure-dev/pull/4744) Support Key Vault references in parameter files.
- - Fix `azd provision` prompting for params with Key Vault references defined.
-- [[4752]](https://github.com/Azure/azure-dev/pull/4752) Support overriding default location in Bicep using `@allowed` and `@metadata` decorators.
- - Fix location picker ignoring `@allowed` list if `@metadata` is also present.
-
-### Other Changes
-
-- [[4741]](https://github.com/Azure/azure-dev/pull/4741) Update Bicep CLI to v0.33.93.
-- [[4719]](https://github.com/Azure/azure-dev/pull/4719) Update Redis AVM to use native secrets export.
-- [[4690]](https://github.com/Azure/azure-dev/pull/4690) Use .NET SDK without Aspire workload in auto-generated pipeline definitions.
-- [[4703]](https://github.com/Azure/azure-dev/pull/4703) Use install scripts in "Install azd" Azure DevOps extension.
-- [[4750]](https://github.com/Azure/azure-dev/pull/4750) Support bicep.v1 resource for .NET Aspire.
-
-## 1.11.1 (2025-01-07)
-
-### Features Added
-
-- [[4244]](https://github.com/Azure/azure-dev/pull/4244) Support azd hooks out of azure.yaml.
-- [[4573]](https://github.com/Azure/azure-dev/pull/4573) Support dotnet publish to produce container image.
-- [[4599]](https://github.com/Azure/azure-dev/pull/4599) Add documentation for azd infra synth.
-
-### Bugs Fixed
-
-- [[4556]](https://github.com/Azure/azure-dev/pull/4556) Fix error about passing by value in for range.
-- [[4585]](https://github.com/Azure/azure-dev/pull/4585) Show full Entra error description on auth failure.
-- [[4666]](https://github.com/Azure/azure-dev/pull/4666) Security fix (GHSA-w32m-9786-jp63). golang.org/x/net.
-- [[4625]](https://github.com/Azure/azure-dev/pull/4625) Security fix (GHSA-v778-237x-gjrc). golang.org/x/crypto.
-
-## 1.11.0 (2024-11-13)
-
-### Features Added
-
-- [[4527]](https://github.com/Azure/azure-dev/pull/4527) Add new `alpha` command `azd add`.
-
-### Bugs Fixed
-
-- [[4524]](https://github.com/Azure/azure-dev/pull/4524) Fix using parameters for .NET Aspire deployment.
-
-## 1.10.4 (2024-11-06)
-
-### Bugs Fixed
-
-- [[4039]](https://github.com/Azure/azure-dev/pull/4039) Use DOTNET_CONTAINER.
-- [[4426]](https://github.com/Azure/azure-dev/pull/4426) Show inner error description for stack deployments.
-- [[4472]](https://github.com/Azure/azure-dev/pull/4472) Fix projects with empty spaces.
-- [[4458]](https://github.com/Azure/azure-dev/pull/4458) Fix panic on empty hooks.
-- [[4484]](https://github.com/Azure/azure-dev/pull/4484) Fix missing quotes in Aspire projects.
-- [[4515]](https://github.com/Azure/azure-dev/pull/4515) Use DOTNET_NOLOGO for Aspire projects.
-
-## 1.10.3 (2024-10-16)
-
-### Bugs Fixed
-
-- [[4450]](https://github.com/Azure/azure-dev/pull/4450) fix `persistSettings` alpha feature.
-
-## 1.10.2 (2024-10-08)
-
-### Features Added
-
-- [[4272]](https://github.com/Azure/azure-dev/pull/4272) Supports configurable `api-version` for container app deployments.
-- [[4286]](https://github.com/Azure/azure-dev/pull/4286) Adds `alpha` feature `alpha.aspire.useBicepForContainerApps` to use bicep for container app deployment.
-- [[4371]](https://github.com/Azure/azure-dev/pull/4371) Adds support for `default.value` for `parameter.v0`.
-
-### Bugs Fixed
-
-- [[4375]](https://github.com/Azure/azure-dev/pull/4375) Enables remote build support for AKS.
-- [[4363]](https://github.com/Azure/azure-dev/pull/4363) Fix environment variables to be evaluated too early for `main.parameters.json`.
-
-### Other Changes
-
-- [[4336]](https://github.com/Azure/azure-dev/pull/4336) Adds spinner to `azd down`.
-- [[4357]](https://github.com/Azure/azure-dev/pull/4357) Updates `azure.yaml.json` for `remoteBuild`.
-- [[4369]](https://github.com/Azure/azure-dev/pull/4369) Updates docker `buildargs` to expandable strings.
-- [[4331]](https://github.com/Azure/azure-dev/pull/4331) Exposes configurable settings for `actionOnUnmanage` and `denySettings` for Azure Deployment Stacks (alpha).
-
-## 1.10.1 (2024-09-05)
-
-### Bugs Fixed
-
-- [[4299]](https://github.com/Azure/azure-dev/pull/4299) Fixes issue in vs-server for Aspire projects.
-- [[4294]](https://github.com/Azure/azure-dev/pull/4294) Fixes azd pipeline config on Codespaces.
-- [[4295]](https://github.com/Azure/azure-dev/pull/4295) Fixes azd pipeline config for Terraform.
-
-## 1.10.0 (2024-09-04)
-
-### Features Added
-
-- [[4165]](https://github.com/Azure/azure-dev/pull/4165) Add support for `alpha` feature Azure Deployment stacks.
-- [[4236]](https://github.com/Azure/azure-dev/pull/4236) Support `args` on `container.{v0,v1}`.
-- [[4257]](https://github.com/Azure/azure-dev/pull/4257) Add support for multiple hooks per event.
-- [[4190]](https://github.com/Azure/azure-dev/pull/4190) Add support for `.azuredevops` folder.
-- [[4161]](https://github.com/Azure/azure-dev/pull/4161) Add remote builds support with Azure Container Registry.
-- [[4254]](https://github.com/Azure/azure-dev/pull/4254) Add support for environment variable substitution for source container image.
-- [[4203]](https://github.com/Azure/azure-dev/pull/4203) Add GitHub as template source configuration option.
-- [[4208]](https://github.com/Azure/azure-dev/pull/4208) Add support for Java Azure Functions.
-
-### Bugs Fixed
-
-- [[4237]](https://github.com/Azure/azure-dev/pull/4237) Fix pipeline config failing bug.
-- [[4263]](https://github.com/Azure/azure-dev/pull/4263) Fix `azd infra synth` ignored by `azd deploy` in azdo CI/CD pipeline bug.
-- [[4281]](https://github.com/Azure/azure-dev/pull/4281) Fix failed provision with the STG location.
-
-### Other Changes
-
-- [[4243]](https://github.com/Azure/azure-dev/pull/4243) Add AI services model deployments to provisioning display.
-
-## 1.9.6 (2024-08-13)
-
-### Features Added
-
-- [[4115]](https://github.com/Azure/azure-dev/pull/4115) Adding `alpha` feature `alpha.aca.persistIngressSessionAffinity`.
-
-### Bugs Fixed
-
-- [[4111]](https://github.com/Azure/azure-dev/pull/4111) Container Apps: Fail when explicit Dockerfile path not found.
-- [[4149]](https://github.com/Azure/azure-dev/pull/4149) Remove Admin Access as default for all .Net Aspire services.
-- [[4104]](https://github.com/Azure/azure-dev/pull/4104) Remove Azure Dev Ops git remote constraint for dev.azure.com only.
-- [[4160]](https://github.com/Azure/azure-dev/pull/4160) Fix automatic generation of CI/CD files for .Net Aspire projects.
-- [[4182]](https://github.com/Azure/azure-dev/pull/4182) Allow `.yaml` and `.yml` extension for azure-dev pipeline files.
-- [[4187]](https://github.com/Azure/azure-dev/pull/4187) Fix panic during deployment progress rendering.
-
-## 1.9.5 (2024-07-10)
-
-### Features Added
-
-- [[4080]](https://github.com/Azure/azure-dev/pull/4080) Add `azd env get-value`.
-
-### Bugs Fixed
-
-- [[4065]](https://github.com/Azure/azure-dev/pull/4065) Fix panic when a project has no endpoints.
-- [[4074]](https://github.com/Azure/azure-dev/pull/4074) Fix error in retrieving cross-rg service plan.
-- [[4073]](https://github.com/Azure/azure-dev/pull/4073) Fix bug where windows logic app passed isLinuxWebApp.
-
-## 1.9.4 (2024-07-02)
-
-### Features Added
-
-- [[3924]](https://github.com/Azure/azure-dev/pull/3924) Updating azd pipeline config to support Federated Credential for Azure DevOps.
-- [[3553]](https://github.com/Azure/azure-dev/pull/3553) Support swa-cli.config.json for Azure Static Web Apps.
-- [[3955]](https://github.com/Azure/azure-dev/pull/3955) Adding `alpha` feature `alpha.aca.persistDomains`.
-- [[3723]](https://github.com/Azure/azure-dev/pull/3723) Add --managed-identity to azd auth login.
-- [[3965]](https://github.com/Azure/azure-dev/pull/3965) Add deployment status tracking for linux web apps.
-- [[4003]](https://github.com/Azure/azure-dev/pull/4003) Add support for deploying flex-consumption function apps.
-- [[4008]](https://github.com/Azure/azure-dev/pull/4008) Add support for container.v1 [Aspire].
-- [[4030]](https://github.com/Azure/azure-dev/pull/4030) Prompt to add pipeline definition file during azd pipeline config.
-- [[3790]](https://github.com/Azure/azure-dev/pull/3790) Adding `alpha` feature `azd.operations` to support .Net Aspire bind mounts.
-- [[4049]](https://github.com/Azure/azure-dev/pull/4049) Adding pipeline config `--applicationServiceManagementReference`.
-
-### Bugs Fixed
-
-- [[3941]](https://github.com/Azure/azure-dev/pull/3941) Fix exposed ports for Aspire projects.
-- [[3948]](https://github.com/Azure/azure-dev/pull/3948) Adds missing namespace property to Helm configuration schema.
-- [[3942]](https://github.com/Azure/azure-dev/pull/3942) Fixes issue selected environment with different environment type.
-- [[3985]](https://github.com/Azure/azure-dev/pull/3985) Reset the read cursor in zip deployments to fix bugs in retry.
-
-### Other Changes
-
-- [[4043]](https://github.com/Azure/azure-dev/pull/4043) wait for Ai-studio deployments before polling.
-
-## 1.9.3 (2024-05-20)
-
-### Other Changes
-
-- [[3925]](https://github.com/Azure/azure-dev/pull/3925) Graduates alpha feature: `Aspire Dashboard`
-- [[3929]](https://github.com/Azure/azure-dev/pull/3929) Graduates alpha feature: `Aspire Auto Configure Data Protection`
-
-## 1.9.2 (2024-05-15)
-
-### Bugs Fixed
-
-- [[3915]](https://github.com/Azure/azure-dev/pull/3915) Revert - Add deployment status tracking for linux web apps.
-
-## 1.9.1 (2024-05-14)
-
-### Bugs Fixed
-
-- [[3876]](https://github.com/Azure/azure-dev/pull/3876) Take infra section of azure.yaml into account.
-- [[3881]](https://github.com/Azure/azure-dev/pull/3881) Make azd to wait until the expected state can be seen from the online endpoint.
-- [[3763]](https://github.com/Azure/azure-dev/pull/3763) Add deployment status tracking for linux web apps.
-- [[3897]](https://github.com/Azure/azure-dev/pull/3897) Update ResolvedRaw() to remove reference to the vault.
-- [[3898]](https://github.com/Azure/azure-dev/pull/3898) Easy Init: Improve handling for empty state.
-- [[3903]](https://github.com/Azure/azure-dev/pull/3903) Fix type issues in PromptDialog with external prompting.
-
-## 1.9.0 (2024-05-07)
-
-### Features Added
-
-- [[3718]](https://github.com/Azure/azure-dev/pull/3718) Deploy AI/ML studio online endpoints with host `ml.endpoint`. Starter templates `azd-ai-starter` and `azd-aistudio-starter` are available to get started with ease.
-- [[3840]](https://github.com/Azure/azure-dev/pull/3840) Filter templates when running `azd init` or `azd template list` with `--filter`
-- .NET Aspire:
- - [[3267]](https://github.com/Azure/azure-dev/pull/3267) Support services with multiple exposed ports
- - [[3820]](https://github.com/Azure/azure-dev/pull/3820) Container resources now supports reference expressions, and are now modeled the same as project resources
-
-### Bugs Fixed
-
-- [[3822]](https://github.com/Azure/azure-dev/pull/3822) Fix Aspire KeyVault references in manifest files
-- [[3858]](https://github.com/Azure/azure-dev/pull/3858) Allow overriding location for Aspire bicep modules
-
-### Other Changes
-
-- [[3821]](https://github.com/Azure/azure-dev/pull/3821) Support running `azd init` in Aspire app host directory
-- [[3848]](https://github.com/Azure/azure-dev/pull/3848) Add "Demo Mode" which hides subscription IDs
-- [[3828]](https://github.com/Azure/azure-dev/pull/3828) Update Bicep CLI to version 0.26.170.
-- [[3800]](https://github.com/Azure/azure-dev/pull/3800) Write ACA Container Manifests in the `infra` directory under the AppHost during `infra synth`.
-
-**Note:** If you had previously used `infra synth`, you will need to move the container app manifests from their old location to the new one for `azd` to use them. If you do not do so, `azd` will generate the default IaC based on your current app host. To do this, move the `containerApp.tmpl.yaml` file in the `manifests` folder under each individual project into an `infra` folder next to the `.csproj` file for your project's Aspire App Host and rename it from `containerApp.tmpl.yaml` to `.tmpl.yaml` (e.g. `apiserver.tmpl.yaml`, if you write `builder.AddProject<...>("apiserver")`).
-
-## 1.8.2 (2024-04-30)
-
-### Features Added
-
-- [[3804]](https://github.com/Azure/azure-dev/pull/3804) Add user vault storage for development secrets
-- [[3755]](https://github.com/Azure/azure-dev/pull/3755) Store `secure()` Bicep parameters outside source tree
-
-### Bugs Fixed
-
-- [[3788]](https://github.com/Azure/azure-dev/pull/3788) Avoid panic in prompting with option details
-- [[3796]](https://github.com/Azure/azure-dev/pull/3796) Fix `env refresh` failing when no bicep files are present
-- [[3801]](https://github.com/Azure/azure-dev/pull/3801) Fix `azd provision` failing for `.bicepparam` files
-
-### Other Changes
-
-- [[3798]](https://github.com/Azure/azure-dev/pull/3798) Update provider.tf files with skip_provider_registration = "true"
-
-## 1.8.1 (2024-04-23)
-
-### Features Added
-
-- [[3731]](https://github.com/Azure/azure-dev/pull/3731) Support Data Protection Runtime feature for .NET Aspire in ACA under feature flag `azd config set alpha.aspire.autoConfigureDataProtection on`
-- [[3715]](https://github.com/Azure/azure-dev/pull/3715) Improved security to prevent committing an environment to the repository
-
-### Bugs Fixed
-
-- [[3748]](https://github.com/Azure/azure-dev/pull/3748) Fix cross-build configuration
-
-## 1.8.0 (2024-04-09)
-
-### Features Added
-
-- [[3569]](https://github.com/Azure/azure-dev/pull/3569) Adds `--from-code ` flag to initialize from existing code when running `azd init`
-- Dotnet Aspire:
- - [[3612]](https://github.com/Azure/azure-dev/pull/3612) Supports Aspire apps with multiple exposed ports
- - [[3484]](https://github.com/Azure/azure-dev/pull/3484) Discovers export port from the result of `dotnet publish`
- - [[3556]](https://github.com/Azure/azure-dev/pull/3556) Adds Aspire volumes support
- - [[3561]](https://github.com/Azure/azure-dev/pull/3561) Supports more input generation in Aspire manifest
-
-### Breaking Changes
-
-- [[3589]](https://github.com/Azure/azure-dev/pull/3589) Secrets are now marked as secure() in `container-app.bicep` and `container-app-upsert.bicep`. Thanks @pamelafox for the contribution
-- [[3594]](https://github.com/Azure/azure-dev/pull/3594) Updates Node.js version to 20 for templates and pipelines
-- [[3578]](https://github.com/Azure/azure-dev/issues/3578) Updates Node.js version to 20 for [installing `azd` GitHub Action](https://github.com/Azure/setup-azd)
-
-### Bugs Fixed
-
-- [[3651]](https://github.com/Azure/azure-dev/pull/3651) Fixes trailing comma for `todo-nodejs-mongo-aks` template's invalid url in GitHub Action
-- [[3638]](https://github.com/Azure/azure-dev/pull/3638) Fixes `InvalidAuthenticationTokenTenant` error
-- Dotnet Aspire:
- - [[3610]](https://github.com/Azure/azure-dev/pull/3610) Fixes too long auto-generated Azure Key Vault name by using Hash
- - [[3650]](https://github.com/Azure/azure-dev/pull/3650) Writes default port to manifest for docker
- - [[3545]](https://github.com/Azure/azure-dev/pull/3545) Updates Aspire generator to use the build args from the dockerfile resources
- - [[3554]](https://github.com/Azure/azure-dev/pull/3554) Fixes `azd infra synth` doesn't convert dashes to underscores in `containerApp.tmpl.yaml`
-
-### Other Changes
-
-- [[3522]](https://github.com/Azure/azure-dev/pull/3522) Fixes typo in `next-steps.md`. Thanks @mikekistler for the contribution
-- [[3495]](https://github.com/Azure/azure-dev/pull/3495) Updates `infra/core` to adapt more azdevify templates
-- [[3171]](https://github.com/Azure/azure-dev/pull/3171) Updates web project `react-fluentui` to use `vite`
-
-## 1.7.0 (2024-03-12)
-
-### Features Added
-
-- [[3450]](https://github.com/Azure/azure-dev/pull/3450) Adds support for pushing container images to external container registries
-- [[3452]](https://github.com/Azure/azure-dev/pull/3452) Adds support for other clouds
-- Dotnet Aspire:
- - [[3349]](https://github.com/Azure/azure-dev/pull/3349) Adds support for bicep and prompts for parameters
- - [[3411]](https://github.com/Azure/azure-dev/pull/3411) Adds support for `value.v0`
- - [[3425]](https://github.com/Azure/azure-dev/pull/3425) Sets `DOTNET_ENVIRONMENT` when running AppHost
-
-### Bugs Fixed
-
-- [[3381]](https://github.com/Azure/azure-dev/pull/3381) Removes session `container` and `manifest` caching
-- [[3407]](https://github.com/Azure/azure-dev/pull/3407) Fixes docker build/package for Aspire projects
-- [[3418]](https://github.com/Azure/azure-dev/pull/3418) Fixes issues where deploying to AKS fails when service does not build any container
-- [[3445]](https://github.com/Azure/azure-dev/pull/3445) Fixes concurrent map issues in dev center client
-- [[3390]](https://github.com/Azure/azure-dev/pull/3390) Fixes issues where the ADE configuration was not being refreshed during `azd init` or `azd provision` in dev center
-- [[3382]](https://github.com/Azure/azure-dev/pull/3382) Cleans empty secrets and variables before setting them again
-- [[3448]](https://github.com/Azure/azure-dev/pull/3448) Fixes issues where `azd infra synth` doesn't generate autogenerate inputs
-- [[3506]](https://github.com/Azure/azure-dev/pull/3506) Fixes service config handlers referencing stale components
-- [[3513]](https://github.com/Azure/azure-dev/pull/3513) Fixes rules for setting secret environment variables in Aspire
-- [[3516]](https://github.com/Azure/azure-dev/pull/3516) Fixes issues where output bicep is invalid when using dash in resource names
-
-### Other Changes
-
-- [[3357]](https://github.com/Azure/azure-dev/pull/3357) Allows selection on existing environments when default environment isn't set
-- [[3282]](https://github.com/Azure/azure-dev/pull/3282) Updates `azure-dev.yaml` for `azd-starter-bicep`. Thanks @IEvangelist for the contribution
-- [[3334]](https://github.com/Azure/azure-dev/pull/3334) Adds MySQL to bicep core. Thanks @john0isaac for the contribution
-- [[3413]](https://github.com/Azure/azure-dev/pull/3413) Adds Azure App Configuration store to bicep core. Thanks @RichardChen820 for the contribution
-- [[3442]](https://github.com/Azure/azure-dev/pull/3442) Updates AKS template tests without playwright validation
-- [[3478]](https://github.com/Azure/azure-dev/pull/3478) Updates `azd` to use default http client
-
-## 1.6.1 (2024-02-15)
-
-### Bugs Fixed
-
-- [[3375]](https://github.com/Azure/azure-dev/pull/3375) Fixes issues deploying to AKS service targets
-- [[3373]](https://github.com/Azure/azure-dev/pull/3373) Fixes resolution of AZD compatible templates within azure dev center catalogs
-- [[3372]](https://github.com/Azure/azure-dev/pull/3372) Removes requirement for dev center projects to include an `infra` folder
-
-## 1.6.0 (2024-02-13)
-
-### Features Added
-
-- [[3269]](https://github.com/Azure/azure-dev/pull/3269) Adds support for external/prebuilt container image references
-- [[3251]](https://github.com/Azure/azure-dev/pull/3251) Adds additional configuration resolving container registry names
-- [[3249]](https://github.com/Azure/azure-dev/pull/3249) Adds additional configuration resolving AKS cluster names
-- [[3223]](https://github.com/Azure/azure-dev/pull/3223) Updates AKS core modules for `azd` to easily enable RBAC clusters
-- [[3211]](https://github.com/Azure/azure-dev/pull/3211) Adds support for RBAC enabled AKS clusters using `kubelogin`
-- [[3196]](https://github.com/Azure/azure-dev/pull/3196) Adds support for Helm and Kustomize for AKS service targets
-- [[3173]](https://github.com/Azure/azure-dev/pull/3173) Adds support for defining customizable `azd up` workflows
-- Dotnet Aspire additions:
- - [[3164]](https://github.com/Azure/azure-dev/pull/3164) Azure Cosmos DB.
- - [[3226]](https://github.com/Azure/azure-dev/pull/3226) Azure SQL Database.
- - [[3276]](https://github.com/Azure/azure-dev/pull/3276) Secrets handling improvement.
-- [[3155]](https://github.com/Azure/azure-dev/pull/3155) Adds support to define secrets and variables for `azd pipeline config`.
-
-### Bugs Fixed
-
-- [[3097]](https://github.com/Azure/azure-dev/pull/3097) For Dotnet Aspire projects, do not fail if folder `infra` is empty.
-
-## 1.5.1 (2023-12-20)
-
-### Features Added
-
-- [[2998]](https://github.com/Azure/azure-dev/pull/2998) Adds support for Azure Storage Tables and Queues on Aspire projects.
-- [[3052]](https://github.com/Azure/azure-dev/pull/3052) Adds `target` argument support for docker build.
-- [[2488]](https://github.com/Azure/azure-dev/pull/2488) Adds support to override behavior of the KUBECONFIG environment variable on AKS.
-- [[3075]](https://github.com/Azure/azure-dev/pull/3075) Adds support for `dockerfile.v0` on Aspire projects.
-- [[2992]](https://github.com/Azure/azure-dev/pull/2992) Adds support for `dapr` on Aspire projects.
-
-### Bugs Fixed
-
-- [[2969]](https://github.com/Azure/azure-dev/pull/2969) Relax container names truncation logic for Aspire `redis.v0` and `postgres.database.v0`.
- Truncation now happens above 30 characters instead of 12 characters.
-- [[3035]](https://github.com/Azure/azure-dev/pull/3035) .NET Aspire issues after `azd pipeline config`.
-- [[3038]](https://github.com/Azure/azure-dev/pull/3038) Fix init to not consider parent directories.
-- [[3045]](https://github.com/Azure/azure-dev/pull/3045) Handle interrupt to unhide cursor.
-- [[3069]](https://github.com/Azure/azure-dev/pull/3069) .NET Aspire, enable `admin user` for ACR.
-- [[3049]](https://github.com/Azure/azure-dev/pull/3049) Persist location from provisioning manager.
-- [[3056]](https://github.com/Azure/azure-dev/pull/3056) Fix `azd pipeline config` for resource group deployment.
-- [[3106]](https://github.com/Azure/azure-dev/pull/3106) Fix `azd restore` on .NET projects.
-- [[3041]](https://github.com/Azure/azure-dev/pull/3041) Ensure azd environment name is synchronized to .env file.
-
-### Other Changes
-
-- [[3044]](https://github.com/Azure/azure-dev/pull/3044) Sets allowInsecure to true for internal services on Aspire projects.
-
-## 1.5.0 (2023-11-15)
-
-### Features Added
-
-- [[2767]](https://github.com/Azure/azure-dev/pull/2767) Adds support for Azure Deployments Environments.
-
-## 1.4.5 (2023-11-13)
-
-### Bugs Fixed
-
-- [[2962]](https://github.com/Azure/azure-dev/pull/2962) Fix for incorrect id on storage blob built-in role id.
-- [[2963]](https://github.com/Azure/azure-dev/pull/2963) Handle project is undetected.
-
-## 1.4.4 (2023-11-10)
-
-### Features Added
-
-- [[2893]](https://github.com/Azure/azure-dev/pull/2893) Added command `azd show`.
-- [[2925]](https://github.com/Azure/azure-dev/pull/2925) Promote simplified `azd init` and Cloud Native buildpacks features to beta
-
-## 1.4.3 (2023-10-24)
-
-### Features Added
-
-- [[2787]](https://github.com/Azure/azure-dev/pull/2787) Added `azd config show` and deprecated `azd config list`.
-
-### Other Changes
-
-- [[2887]](https://github.com/Azure/azure-dev/pull/2887) Update the subscription and location information during `azd provision`.
-
-## 1.4.2 (2023-10-12)
-
-### Features Added
-
-- [[2845]](https://github.com/Azure/azure-dev/pull/2845) Feature Clickable Template Links in Terminal (azd template list). Thanks @john0isaac for the contribution
-- [[2829]](https://github.com/Azure/azure-dev/pull/2829) Feature Display the Subscription Name and ID (azd provision). Thanks @john0isaac for the contribution
-
-### Bugs Fixed
-
-- [[2858]](https://github.com/Azure/azure-dev/pull/2858) Fixes issue with running VS Code Tasks that rely on environment configuration path.
-
-## 1.4.1 (2023-10-06)
-
-### Bugs Fixed
-
-- [[2837]](https://github.com/Azure/azure-dev/pull/2837) `azd down` does not clear provision state.
-
-## 1.4.0 (2023-10-05)
-
-### Features Added
-
-- [[2725]](https://github.com/Azure/azure-dev/pull/2725) Adds support for provision state to the bicep provider.
-- [[2765]](https://github.com/Azure/azure-dev/pull/2765) Support for remote environments.
-- [[1642]](https://github.com/Azure/azure-dev/pull/1642) A new `azd hooks run` command for running and testing your hooks.
-
-### Bugs Fixed
-
-- [[2793]](https://github.com/Azure/azure-dev/pull/2793) Support user defined types for the bicep provider.
-- [[2543]](https://github.com/Azure/azure-dev/pull/2543) `azd package` now allows users to specify `--output-path` parameter to control the output location of file-based packages.
-- [[2302]](https://github.com/Azure/azure-dev/pull/2302) `azd config --help` doesn't show help for `AZD_CONFIG_DIR`.
-- [[2050]](https://github.com/Azure/azure-dev/pull/2050) `azd init` now supports `--subscription`.
-- [[2695]](https://github.com/Azure/azure-dev/pull/2695) `azd` now honors `@allowed` locations in Bicep to filter the list of possible deploy locations.
-- [[2599]](https://github.com/Azure/azure-dev/pull/2599) ARM64 support is now generally available.
-- [[2683]](https://github.com/Azure/azure-dev/pull/2683) Bicep installer prefers MUSL variant over glibc.
-- [[2794]](https://github.com/Azure/azure-dev/pull/2794) When running `azd init`, the Starter - Bicep template is unavailable.
-
-### Other Changes
-
-- [[#2796]](https://github.com/Azure/azure-dev/pull/2796) Update `terraform` provider from alpha to beta.
-
-## 1.3.1 (2023-09-20)
-
-### Minor Changes
-
-- [[2737]](https://github.com/Azure/azure-dev/pull/2737) Update bicep to 0.21.1
-- [[2696]](https://github.com/Azure/azure-dev/pull/2696) Support filtering for azd location in bicep
-- [[2721]](https://github.com/Azure/azure-dev/pull/2721) `azd package` support for user specified output paths
-- [[2756]](https://github.com/Azure/azure-dev/pull/2756) Minor enhancements to simplified init
-
-### Bugs Fixed
-
-- [[2719]](https://github.com/Azure/azure-dev/pull/2719) Fix mistypes in soft delete warning message
-- [[2722]](https://github.com/Azure/azure-dev/pull/2722) Prefer glibc based Bicep when both musl and glibc are installed
-- [[2726]](https://github.com/Azure/azure-dev/pull/2726) Mention `AZD_CONFIG_DIR` in `azd config --help` help text
-
-## 1.3.0 (2023-09-06)
-
-### Features Added
-
-- [[2573]](https://github.com/Azure/azure-dev/pull/2573) Adds support for custom template sources.
-- [[2637]](https://github.com/Azure/azure-dev/pull/2637) Awesome azd templates are now shown by default in `azd init` template listing.
-- [[2628]](https://github.com/Azure/azure-dev/pull/2628) Support for `.bicepparam`.
-- [[2700]](https://github.com/Azure/azure-dev/pull/2700) New simplified `azd init` to initialize your existing application for Azure (alpha feature)
-- [[2678]](https://github.com/Azure/azure-dev/pull/2678) Support for Cloud Native Buildpacks (alpha feature)
-
-### Breaking Changes
-
-### Bugs Fixed
-
-- [[2624]](https://github.com/Azure/azure-dev/pull/2624) Fix provisioning deployment display not showing progress when certain errors occur.
-- [[2676]](https://github.com/Azure/azure-dev/pull/2676) Fix `buildArgs` support for docker build.
-- [[2698]](https://github.com/Azure/azure-dev/pull/2698) Fix `azd auth login` default browser prompt in Codespaces environments.
-- [[2664]](https://github.com/Azure/azure-dev/pull/2664) Fix `azd auth login` login loop after upgrading to 1.2.0.
-- [[2630]](https://github.com/Azure/azure-dev/pull/2630) Fix coloring for ignored operations in `azd provision --preview`
-
-### Other Changes
-
-- [[2660]](https://github.com/Azure/azure-dev/pull/2660) Starter templates now include `core` libraries by default.
-
-## 1.2.0 (2023-08-09)
-
-### Features Added
-
-- [[2550]](https://github.com/Azure/azure-dev/pull/2550) Add `--preview` to `azd provision` to get the changes.
-- [[2521]](https://github.com/Azure/azure-dev/pull/2521) Support `--principal-id` param for azd pipeline config to reuse existing service principal.
-- [[2455]](https://github.com/Azure/azure-dev/pull/2455) Adds optional support for text templates in AKS k8s manifests.
-
-### Bugs Fixed
-
-- [[2569]](https://github.com/Azure/azure-dev/pull/2569) Fix `azd down` so it works after a failed `azd provision`.
-- [[2367]](https://github.com/Azure/azure-dev/pull/2367) Don't fail AKS deployment for failed environment substitution.
-- [[2576]](https://github.com/Azure/azure-dev/pull/2576) Fix `azd auth login` unable to launch browser on WSL.
-
-### Other changes
-
-- [[2572]](https://github.com/Azure/azure-dev/pull/2572) Decrease expiration time of service principal secret from default (24 months) to 180 days.
-- [[2500]](https://github.com/Azure/azure-dev/pull/2500) Promoted Azure Spring Apps from `alpha` to `beta`.
-
-## 1.1.0 (2023-07-12)
-
-### Features Added
-
-- [[2364]](https://github.com/Azure/azure-dev/pull/2364) Display docker output during `package` and `deploy`.
-- [[2463]](https://github.com/Azure/azure-dev/pull/2463) Support `--docs` flag for all azd commands to show official documentation website.
-
-### Bugs Fixed
-
-- [[2390]](https://github.com/Azure/azure-dev/pull/2367) Fixes unmarshalling of k8s ingress resources with TLS hosts
-- [[2402]](https://github.com/Azure/azure-dev/pull/2279) Support for workload profiles in Azure Container Apps
-- [[2428, 2040]](https://github.com/Azure/azure-dev/pull/2468) Include current git branch in GitHub federated credentials
-
-### Other Changes
-
-- [[1118]](https://github.com/Azure/azure-dev/pull/1118) Add `azd` as a devcontainer feature. Thanks [aaronpowell](https://github.com/aaronpowell) for their contributions to this feature and for updating our templates to use this new feature!
-
-## 1.0.2 (2023-06-14)
-
-### Features Added
-
-- [[2266]](https://github.com/Azure/azure-dev/pull/2266) Support for buildArgs on Docker builds.
-- [[2322]](https://github.com/Azure/azure-dev/pull/2322) Support Azure Spring Apps consumption dedicated plan.
-
-### Bugs Fixed
-
-- [[2348]](https://github.com/Azure/azure-dev/pull/2279) Support purging Managed HSMs.
-- [[2362]](https://github.com/Azure/azure-dev/pull/2362) Prevent more errors from interrupting console progress.
-- [[2366]](https://github.com/Azure/azure-dev/pull/2366) Fixes issue where hooks inline script slashes are replaced.
-- [[2375]](https://github.com/Azure/azure-dev/pull/2375) Store numeric values with leading zeros in .env correctly.
-- [[2401]](https://github.com/Azure/azure-dev/pull/2401) Fix the application url fetched from ASA consumption plan.
-- [[2426]](https://github.com/Azure/azure-dev/pull/2426) Fix saving of subscription and location defaults.
-
-### Other Changes
-
-- [[2337]](https://github.com/Azure/azure-dev/pull/2337) Update device-code auth flow.
-
-## 1.0.1 (2023-05-25)
-
-### Bugs Fixed
-
-- [[2300]](https://github.com/Azure/azure-dev/pull/2300) Fix `azd auth login` failing with error "reauthentication required: run `azd auth login` to log in" due to stale cache data.
-
-## 1.0.0 (2023-05-22)
-
-### Bugs Fixed
-
-- [[2279]](https://github.com/Azure/azure-dev/pull/2279) Fetch k8s GPG key from alternate location.
-- [[2278]](https://github.com/Azure/azure-dev/pull/2278) Remove infrastructure outputs from .env on azd down.
-- [[2274]](https://github.com/Azure/azure-dev/pull/2274) Change AKS service spec 'targetPort' from int to string.
-
-## 0.9.0-beta.3 (2023-05-19)
-
-### Features Added
-
-- [[2245]](https://github.com/Azure/azure-dev/pull/2245) Add support to login to Azure Container Registry with current identity.
-- [[2228]](https://github.com/Azure/azure-dev/pull/2228) Add error classification and reporting for external errors to `azd`.
-- [[2219]](https://github.com/Azure/azure-dev/pull/2219) Support environment name as explicit argument for `azd env refresh`.
-- [[2164]](https://github.com/Azure/azure-dev/pull/2164) Add timing information on `up`,`package`,`build`, `provision`,`deploy`, `down` and `restore` commands.
-
-#### Template Feature
-
-- [[2157]](https://github.com/Azure/azure-dev/pull/2157) Add `Dapr` and container configuration properties to Azure Container Apps modules.
-
-### Bugs Fixed
-
-- [[2257]](https://github.com/Azure/azure-dev/pull/2257) Add purge option of cognitive accounts for `azd down`.
-- [[2243]](https://github.com/Azure/azure-dev/pull/2243) Return error when login fails.
-- [[2251]](https://github.com/Azure/azure-dev/pull/2251) Create an `alpha` version of azure.yaml schema with `terraform`.
-- [[2028]](https://github.com/Azure/azure-dev/pull/2028) Add check on required role assignments for `azd pipeline config`.
-
-### Other Changes
-
-- [[2218]](https://github.com/Azure/azure-dev/pull/2218) Update `azd pipeline config` default roles to include `User Access Administrator`.
-- [[2185]](https://github.com/Azure/azure-dev/pull/2185) Improve error messages on `auth` command.
-
-## 0.9.0-beta.2 (2023-05-11)
-
-### Bugs Fixed
-
-- [[2177]](https://github.com/Azure/azure-dev/issues/2177) Use information in `.installed-by.txt` to advise the user on how to upgrade azd.
-- [[2183]](https://github.com/Azure/azure-dev/pull/2182) Statically link CRT in MSI custom action.
-
-## 0.9.0-beta.1 (2023-05-11)
-
-### Features Added
-
-- [[1808]](https://github.com/Azure/azure-dev/pull/1808) Support for Azure Spring Apps(alpha feature).
-- [[2083]](https://github.com/Azure/azure-dev/pull/2083) Allow resource group scope deployments(alpha feature).
-
-### Breaking Changes
-
-- [[2066]](https://github.com/Azure/azure-dev/pull/2066) `azd` no longer assumes `dotnet` by default when `services.language` is not set, or empty in `azure.yaml`. If you receive an error message 'language property must not be empty', specify `language: dotnet` explicitly in `azure.yaml`.
-- [[2100]](https://github.com/Azure/azure-dev/pull/2100) As a follow up from the change for [azd up ordering](#azd-up-ordering), automatic `.env` file injection when building `staticwebapp` services have been removed. For more details, read more about [Static Web App Dynamic Configuration](#static-web-app-dynamic-configuration) below.
-- [[2126]](https://github.com/Azure/azure-dev/pull/2126) During `azd pipeline config` commands `azd` will no longer store non-secret configuration values in [GitHub secrets](https://docs.github.com/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) and instead will be stored in [GitHub variables](https://docs.github.com/actions/learn-github-actions/variables). Non-secret variables should be referenced using the `vars` context instead of the `secrets` context within your GitHub actions.
-- [[1989]](https://github.com/Azure/azure-dev/pull/1989) Refactor Container App service target. Deploy will fail if you are using Azure Container Apps that are not deploying the Azure Container Apps resources as part of the initial `provision` step.
-
-### Bugs Fixed
-
-- [[2071]](https://github.com/Azure/azure-dev/pull/2071) Fix `azd config reset` causing a logout to occur.
-- [[2048]](https://github.com/Azure/azure-dev/pull/2048) Fix `azd down` deletion on an empty resource group environment.
-- [[2088]](https://github.com/Azure/azure-dev/pull/2088) Fix error when running `azd pipeline config --provider azdo` on Codespaces.
-- [[2094]](https://github.com/Azure/azure-dev/pull/2094) Add error check for pipeline yml file and ssh interaction when running `azd pipeline config`.
-
-#### Template Fix
-- [[2013]](https://github.com/Azure/azure-dev/pull/2013) Fix `load template missing` error in `azd env list`.
-- [[2001]](https://github.com/Azure/azure-dev/pull/2001) Fix Azure Container Apps CORS strategy for Java, NodeJs and Python.
-
-### Other Changes
-
-- [[2026]](https://github.com/Azure/azure-dev/pull/2026) Improve provisioning performance for `dotnet` services by batching `dotnet user-secret` updates.
-- [[2004]](https://github.com/Azure/azure-dev/pull/2004) Improve error message when no subscriptions are found.
-- [[1792]](https://github.com/Azure/azure-dev/pull/1792) Add `java postgresql terraform` template.
-- [[2055]](https://github.com/Azure/azure-dev/pull/2055) Add new starter templates for bicep and terraform.
-- [[2090]](https://github.com/Azure/azure-dev/pull/2090) Update todo templates names and descriptions.
-
-#### Static Web App Dynamic Configuration
-
-This change affects `staticwebapp` services that are currently relying on azd provided `.env` file variables during `azd deploy`. If you have an application initialized from an older `azd` provided Static Web App template (before April 10, 2023), we recommend adopting the latest changes if you're relying on `.env` variables being present. A way to check whether this affects you is by looking at contents in `azure.yaml`:
-
-Old, uptake needed:
-
-```yaml
-# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
-
-name:
-metadata:
- template: todo-nodejs-mongo-swa-func@0.0.1-beta
-services:
- web:
- project: ./src/web
- dist: build
- language: js
- host: staticwebapp
- api:
- project: ./src/api
- language: js
- host: function
-```
-
-New, no changes necessary:
-
-```yaml
-# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
-
-name:
-metadata:
- template: todo-python-mongo-swa-func@0.0.1-beta
-services:
- web:
- project: ./src/web
- dist: build
- language: js
- host: staticwebapp
- hooks:
- predeploy:
- posix:
- shell: sh
- run: node entrypoint.js -o ./build/env-config.js
- continueOnError: false
- interactive: false
- windows:
- shell: pwsh
- run: node entrypoint.js -o ./build/env-config.js
- continueOnError: false
- interactive: false
- api:
- project: ./src/api
- language: py
- host: function
-```
-
-From the example above, dynamic configuration can still be generated from azd `.env` files by creating a `predeploy` hook that embeds the configuration into web assets. See an example change [here](https://github.com/Azure-Samples/todo-nodejs-mongo-swa-func/commit/50f9268881717a796167c371cb60525f83be8a59#diff-fa5d677aeff171483fa03a69284506672cb9afafa0a7139e03a336e4fb7b773f).
-
-## 0.8.0-beta.2 (2023-04-20)
-
-### Features Added
-
-- [[#1931]](https://github.com/Azure/azure-dev/pull/1931) Support *.war and *.ear java archive files, and specify a specific archive file if multiple archives are present.
-- [[#1704]](https://github.com/Azure/azure-dev/pull/1704) Add `requiredVersions` to `azure.yaml`.
-- [[#1924]](https://github.com/Azure/azure-dev/pull/1924) Improve UX on `azd down`.
-- [[#1807]](https://github.com/Azure/azure-dev/pull/1807) Retrieves credentials using the token endpoint on `CloudShell`.
-
-### Bugs Fixed
-
-- [[#1923]](https://github.com/Azure/azure-dev/pull/1923) Fix `Python CLI not installed` error when Python is installed.
-- [[#1963]](https://github.com/Azure/azure-dev/pull/1963) Update GitHub federated auth token provider to allow for fetching of tokens when tokens expire.
-- [[#1967]](https://github.com/Azure/azure-dev/pull/1967) Display provisioning resources in `Failed` state.
-- [[#1940]](https://github.com/Azure/azure-dev/pull/1940) Detect and update environment changes before and after hook executions.
-- [[#1970]](https://github.com/Azure/azure-dev/pull/1970) Fix `pipeline config` issues on Codespaces for `GitHub cli` and `git cli` auth.
-- [[#1982]](https://github.com/Azure/azure-dev/pull/1982) Ensure directory has user "execute" permissions.
-
-## 0.8.0-beta.1 (2023-04-10)
-
-### Features Added
-
-- [[#1715]](https://github.com/Azure/azure-dev/pull/1715) Adding feature alpha toggle:
- - Moving terraform provider as alpha feature. Use `azd config set alpha.terraform on` to have it enabled.
-- [[#1833]](https://github.com/Azure/azure-dev/pull/1833) Deploy from existing package using `--from-package` flag.
-
-### Breaking Changes
-
-- [[#1715]](https://github.com/Azure/azure-dev/pull/1715) Using `terraform` as provisioning provider will fail and require user to enable terraform running `azd config set alpha.terraform on`.
-- [[#1801]](https://github.com/Azure/azure-dev/pull/1801) Restructuring specific command flags.
- - `azd up` no longer runs `azd init`. As a result, the following flags have been removed from `azd up`:
- - `--template` / `-t`
- - `--location` / `-l`
- - `--branch` / `-b`
- - `--subscription`
- - Use of `--service` and `--no-progress` in `azd up` is being deprecated.
- - `azd deploy` now accepts a positional argument. Use `azd deploy ` instead of `azd deploy --service `
- - Deprecate `--no-progress` flag as it currently does nothing. A warning message is shown when used.
- - Hide `--output` flag in the usage printout to correctly reflect the current it's current alpha-preview status. The output contract for structured schema such as JSON has yet been finalized.
-- [[#1804]](https://github.com/Azure/azure-dev/pull/1804) Adjust command aliases.
- - `azd login` and `azd logout` are now available as `azd auth login` and `azd auth logout` respectively. `azd login` and `azd logout` are still available for use, but will be removed in a future release.
- - `azd infra create` and `azd infra delete`, which have always been aliases for `azd provision` and `azd down`, are now deprecated. The commands are still available for use, but will be removed in a future release.
-- [[#1824]](https://github.com/Azure/azure-dev/pull/1824) Add working directory sensitivity for `restore` and `deploy`.
- - `azd deploy` will now deploy the current service, when the current working directory is set to a service directory.
- - `azd deploy` will deploy all services, when the current working directory is set to the project directory containing `azure.yaml`
- - In other directories, `azd deploy` will not attempt a deployment and instead error out with suggestions. `azd deploy --all` can be used to deploy all services, or `azd deploy ` to deploy a given service always.
-- [[#1752]](https://github.com/Azure/azure-dev/pull/1752) Ask fewer questions during `init`.
- - `azd init` will now only prompt for the environment name. Azure subscription and location values are prompted only when infrastructure provisioning is needed, when running `azd provision`, and consequently when running `azd up`.
-
-### Bugs Fixed
-
-- [[#1734]](https://github.com/Azure/azure-dev/pull/1734) Fix setting `AZURE_PRINCIPAL_ID` on multi-tenant directory.
-- [[#1738]](https://github.com/Azure/azure-dev/pull/1738) Fix generating auth token on multi-tenant directory.
-- [[#1762]](https://github.com/Azure/azure-dev/pull/1762) Allow local files to be kept when running `init`.
-- [[#1764]](https://github.com/Azure/azure-dev/pull/1764) Enhance zip-deploy during build for:
- - Python: Do not include virtual environments for python.
- - Node: Update node modules detection to exclude it from build.
-- [[#1857]](https://github.com/Azure/azure-dev/pull/1857) Adds `package` command hooks to azd schema.
-- [[#1878]](https://github.com/Azure/azure-dev/pull/1878) Ensure default generated docker repo/tags are all lowercase.
-- [[#1875]](https://github.com/Azure/azure-dev/pull/1875) Fixes panic for `postpackage` hook errors.
-
-### Other Changes
-
-#### `azd up` no longer runs `azd init`
-
-The behavior of `azd up -t ` can be reproduced with:
-
-```bash
-cd
-azd init -t
-azd up
-```
-
-#### `azd deploy` no longer deploys all services when ran in any directory
-
-The new behavior is as follows:
-
-1. `azd deploy` will now deploy the current service, when the current working directory is set to a service directory.
-2. `azd deploy` will deploy all services, when the current working directory is set to the project directory containing `azure.yaml`.
-3. In other directories, `azd deploy` will not attempt a deployment and error out with suggestions. `azd deploy --all` can be used to deploy all services, or `azd deploy ` to deploy a given service always.
-
-#### `azd up` ordering
-
-`azd up` now packages artifacts prior to running `azd provision` and `azd deploy`. This should not affect most users, with the exception of users that may be taking advantage of `azd`'s environment values in packaging `staticwebapp` services. If `azd up` no longer works as expected, and you are currently taking advantage of `azd`'s provided environment values to package your application, a `predeploy` hook may be used to generate configuration files from `azd` environment values. See the working example in our ToDo templates that leverage `staticwebapp`, example [here](https://github.com/Azure-Samples/todo-python-mongo-swa-func/blob/main/azure.yaml). Note that script `hooks` automatically have `azd` environment values loaded in the shell environment.
-
-## 0.7.0-beta.1 (2023-03-09)
-
-### Features Added
-
-- [[#1515]](https://github.com/Azure/azure-dev/pull/1515) Remove gh-cli as external dependency for `azd pipeline config`.
-- [[#1558]](https://github.com/Azure/azure-dev/pull/1558) Upgrade bicep version to 0.14.46 and fetch ARM specific version on ARM platforms.
-- [[#1611]](https://github.com/Azure/azure-dev/pull/1611) Updated formatting for displaying command's help.
-- [[#1629]](https://github.com/Azure/azure-dev/pull/1629) Add support for Azure Kubernetes Service (AKS) target.
-
-### Bugs Fixed
-
-- [[#1631]](https://github.com/Azure/azure-dev/pull/1631) Fail fast during `azd init` when `git` is not installed.
-- [[#1559]](https://github.com/Azure/azure-dev/pull/1559) No feedback output during provisioning some templates.
-- [[#1683]](https://github.com/Azure/azure-dev/pull/1683) Fix `azd pipeline config` to honor provider from `azure.yaml`.
-- [[#1578]](https://github.com/Azure/azure-dev/pull/1578) Fix crash while running `azd login`, due to a tenant `DisplayName` being nil.
-
-Thanks to community members: @pamelafox, @tonybaloney, @cobey for their contributions in this release.
-
-## 0.6.0-beta.2 (2023-02-10)
-
-### Bugs Fixed
-
-- [[#1527]](https://github.com/Azure/azure-dev/pull/1527) Fix running specific commands with `--output json` causing stack overflow errors to occur.
-- [[#1534]](https://github.com/Azure/azure-dev/pull/1534) Fix running commands with `-e ` flag or with `AZURE_ENV_NAME` set not being respected. When running in CI environments, this caused prompting to occur, and failing if `--no-prompt` is specified.
-
-## 0.6.0-beta.1 (2023-02-08)
-
-### Features Added
-
-- [[#1236]](https://github.com/Azure/azure-dev/pull/1236) Support for command and service hooks
-- [[#1414]](https://github.com/Azure/azure-dev/pull/1414) Support for installation via Homebrew. Windows Package Manager, and Chocolatey are also now supported.
-- [[#1407]](https://github.com/Azure/azure-dev/pull/1407) Improve UX styling for `azd pipeline config`.
-- [[#1478]](https://github.com/Azure/azure-dev/pull/1478) Support for multiple Azure tenants.
-
-- [[#1345]](https://github.com/Azure/azure-dev/pull/1345) Core bicep module `appservice.bicep` now supports `ftpsState` as a parameter to configure FTPS upload behavior.
-- [[#1497]](https://github.com/Azure/azure-dev/pull/1497) Core bicep module `appservice.bicep` now supports `healthCheckPath` as a parameter to configure the health-check endpoint.
-- [[#1403]](https://github.com/Azure/azure-dev/pull/1403) Core bicep module `apim-api.bicep` now links Web App or Function App instances. This allows users on the Azure Portal to navigate to the API management resource directly from the Web App or Function App.
-
-### Bugs Fixed
-
-- [[#1406]](https://github.com/Azure/azure-dev/pull/1424) On Windows, fix MSI installation not updating `azd` in some cases (reported by @lechnerc77, fixed by @heaths)
-- [[#1418]](https://github.com/Azure/azure-dev/pull/1418) Display `provision` progress for PostgreSQL server resources.
-- [[#1483]](https://github.com/Azure/azure-dev/pull/1483) For Python projects, skip packaging of virtual environment (`.venv` folders)
-- [[#1495]](https://github.com/Azure/azure-dev/pull/1495) `init` now restores file executable permissions and initializes a `git` repository automatically.
-- [[#1470]](https://github.com/Azure/azure-dev/pull/1470) Improve performance of `azd --help` on Windows for domain-joined users.
-- [[#1503]](https://github.com/Azure/azure-dev/pull/1503) Fix display for Function App types in `provision` progress
-
-Thanks to community members: @pamelafox, @lechnerc77 for their contributions in this release.
-
-## 0.5.0-beta.3 (2023-01-13)
-
-### Bugs Fixed
-
-- [[#1394]](https://github.com/Azure/azure-dev/pull/1394) Bug when running azd up with a template.
-
-## 0.5.0-beta.2 (2023-01-12)
-
-### Bugs Fixed
-
-- [[#1366]](https://github.com/Azure/azure-dev/issues/1366) Login not possible with personal account after upgrade to 0.5.0.
-
-## 0.5.0-beta.1 (2023-01-11)
-
-### Features Added
-
-- [[#1311]](https://github.com/Azure/azure-dev/pull/1311) Add support to install script with MSI on Windows.
-- [[#1312]](https://github.com/Azure/azure-dev/pull/1312) Allow users to configure service endpoints using `SERVICE__ENDPOINTS`.
-- [[#1323]](https://github.com/Azure/azure-dev/pull/1323) Add API Management Service support for all templates.
-- [[#1326]](https://github.com/Azure/azure-dev/pull/1326) Add purge support for API Management Service.
-- [[#1076]](https://github.com/Azure/azure-dev/pull/1076) Refactor the Bicep tool in azd to use the standalone API vs az command wrapper.
-- [[#1087]](https://github.com/Azure/azure-dev/pull/1087) Add NodeJs and Terraform devcontainer.
-- [[#965]](https://github.com/Azure/azure-dev/pull/965) Add UX style for `azd init`.
-- [[#1100]](https://github.com/Azure/azure-dev/pull/1100) Add Shell completion.
-- [[#1086]](https://github.com/Azure/azure-dev/pull/1086) Add FederatedIdentityCredentials (FICS).
-- [[#1177]](https://github.com/Azure/azure-dev/pull/1177) Add command `azd auth token`.
-- [[#1210]](https://github.com/Azure/azure-dev/pull/1210) Have azd acquire Bicep.
-- [[#1133]](https://github.com/Azure/azure-dev/pull/1133) Add UX style for `azd provision`.
-- [[#1248]](https://github.com/Azure/azure-dev/pull/1248) Support `redirect port` for `azd login`.
-- [[#1269]](https://github.com/Azure/azure-dev/pull/1269) Add UX style for `azd deploy`.
-
-### Breaking Changes
-
-- [[#1129]](https://github.com/Azure/azure-dev/pull/1129) Remove all dependencies on az cli.
-- [[#1105]](https://github.com/Azure/azure-dev/pull/1105) `azd env new` now accepts the name of the environment as the first argument, i.e. `azd env new `. Previously, this behavior was accomplished via the global environment flag `-e`, i.e. `azd env new -e `.
-- [[#1022]](https://github.com/Azure/azure-dev/pull/1022) `azd` no longer uses the `az` CLI to authenticate with Azure by default. You will need to run `azd login` after upgrading. You may run `azd config set auth.useAzCliAuth true` to restore the old behavior of using `az` for authentication.
-
-### Bugs Fixed
-
-- [[#1107]](https://github.com/Azure/azure-dev/pull/1107) Fix Bicep path not found.
-- [[#1096]](https://github.com/Azure/azure-dev/pull/1096) Fix Java version check for major-only release.
-- [[#1105]](https://github.com/Azure/azure-dev/pull/1105) Fix `env new` to use positional argument.
-- [[#1168]](https://github.com/Azure/azure-dev/pull/1168) Fix purge option for command `azd down --force --purge` to purge key vaults and app configurations resources.
-
-If you have existing pipelines that use `azd`, you will need to update your pipelines to use the new `azd` login methods when authenticating against Azure.
-
-**GitHub Actions pipelines**:
-
-Update your `azure-dev.yml` to stop using the `azure/login@v1` action, and instead log in using `azd` directly. To do so, replace:
-
-```yaml
-- name: Log in with Azure
- uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
-```
-
-with
-
-```yaml
-- name: Log in with Azure
- run: |
- $info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;
- Write-Host "::add-mask::$($info.clientSecret)"
-
- azd login `
- --client-id "$($info.clientId)" `
- --client-secret "$($info.clientSecret)" `
- --tenant-id "$($info.tenantId)"
- shell: pwsh
- env:
- AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
-```
-
-**Azure DevOps pipelines**:
-
-Update your `azure-dev.yml` file to force `azd` to use `az` for authentication. To do so, add a new step before any other steps which use `azd`:
-
-```yaml
-- pwsh: |
- azd config set auth.useAzCliAuth "true"
- displayName: Configure azd to Use az CLI Authentication.
-```
-
-We plan to improve this behavior with [[#1126]](https://github.com/Azure/azure-dev/issues/1126).
-
-## 0.4.0-beta.1 (2022-11-02)
-
-### Features Added
-
-- [[#773]](https://github.com/Azure/azure-dev/pull/773) Add support for Java with Maven.
-- [[#1026]](https://github.com/Azure/azure-dev/pull/1026), [[#1021]](https://github.com/Azure/azure-dev/pull/1021) New official templates: ToDo with Java on App Service, ToDo with Java on Azure Container Apps, ToDo with C# on Azure Functions
-- [[#967]](https://github.com/Azure/azure-dev/pull/967) New `azd config` command for managing default subscription and location selections.
-- [[#1035]](https://github.com/Azure/azure-dev/pull/1035) Add terraform support for Azure Pipelines created using `azd pipeline config`.
-
-### Bugs Fixed
-
-- [[#1060]](https://github.com/Azure/azure-dev/pull/1060) Fix color rendering on Windows.
-- [[#1011]](https://github.com/Azure/azure-dev/pull/1011) Improve error printout for deployment failures.
-- [[#991]](https://github.com/Azure/azure-dev/pull/991) Fix `devcontainers.json` to use non-deprecated syntax.
-- [[#996]](https://github.com/Azure/azure-dev/pull/996) ToDo templates:
- - Fix cases where provisioning of app settings would succeed, but app settings configuration would not take place.
- - Move resource naming to `main.bicep` and remove `resources.bicep` from templates.
-
-## 0.3.0-beta.5 (2022-10-26)
-
-### Bugs Fixed
-
-- [[#979]](https://github.com/Azure/azure-dev/pull/979) Fix provisioning template with non string outputs.
-
-## 0.3.0-beta.4 (2022-10-25 **DEPRECATED**)
-
-### Bugs Fixed
-
-- [[#979]](https://github.com/Azure/azure-dev/pull/979) Fix provisioning template with non string outputs.
-
-## 0.3.0-beta.3 (2022-10-21)
-
-### Features Added
-
-- [[#878]](https://github.com/Azure/azure-dev/pull/878) `azd down` supports purge of app configuration stores.
-
-### Bugs Fixed
-
-- [[#925]](https://github.com/Azure/azure-dev/pull/925) Fix issues where running `azd infra create` with `--output==json` would emit invalid JSON. As part of this change, we now no longer emit multiple objects to `stdout` as part of an operation. Instead, progress messages are streamed in a structured way to `stderr`.
-
-### Other Changes
-
-- [[#691]](https://github.com/Azure/azure-dev/pull/691) Rearrange Terraform templates by extracting common resources and using these common modules.
-- [[#892]](https://github.com/Azure/azure-dev/pull/892) Simplify template bicep modules.
-
-## 0.3.0-beta.2 (2022-10-05)
-
-### Bugs Fixed
-
-- [[#795]](https://github.com/Azure/azure-dev/pull/795) Fix cases where clicking the Azure deployment progress link provided in `azd provision` might result in a 404 NotFound error page due to timing.
-- [[#755]](https://github.com/Azure/azure-dev/pull/755) Fix cases where `azd pipeline config` might fail in pushing the repository due to cached credentials.
-
-## 0.3.0-beta.1 (2022-09-30)
-
-### Features Added
-
-- [[#743]](https://github.com/Azure/azure-dev/pull/743) Azure DevOps support for pipeline config command.
-
-### Bugs Fixed
-
-- [[#730]](https://github.com/Azure/azure-dev/pull/730) Fix hierarchical configuration keys for dotnet to show up correctly when stored as dotnet user-secrets. Thanks community member [@sebastianmattar](https://github.com/sebastianmattar) for providing the initial fix!
-- [[#761]](https://github.com/Azure/azure-dev/pull/761) Fix error in `azd deploy` when multiple resource groups are defined in bicep
-
-## 0.2.0-beta.2 (2022-09-21)
-
-### Bugs Fixed
-
-- [[#724]](https://github.com/Azure/azure-dev/pull/724) Fix version check for supporting Docker CE / Moby schemes.
-
-### Other Changes
-
-- [[#548]](https://github.com/Azure/azure-dev/pull/548) Refactor template bicep into modules.
-
-## 0.2.0-beta.1 (2022-09-14)
-
-### Features Added
-
-- [[#172]](https://github.com/Azure/azure-dev/pull/172) Implement Infrastructure Provision Provider Model.
-- [[#573]](https://github.com/Azure/azure-dev/pull/573) Add support for Terraform for infrastructure as code (IaC).
-- [[#532]](https://github.com/Azure/azure-dev/pull/532) Add Terraform support for Python template.
-- [[#646]](https://github.com/Azure/azure-dev/pull/646) Add Terraform support for Node.js template.
-- [[#550]](https://github.com/Azure/azure-dev/pull/550) Add C# + Azure SQL template.
-
-### Breaking Changes
-
-- [[#588]](https://github.com/Azure/azure-dev/pull/588) Update default view from `azd monitor` to overview dashboard.
-
-## 0.1.0-beta.5 (2022-08-25)
-
-### Bugs Fixed
-
-- [[#461]](https://github.com/Azure/azure-dev/pull/461) Fix for using a command output other than JSON.
-- [[#480]](https://github.com/Azure/azure-dev/pull/480) Fix deploy error when using an environment name with capital letters.
-
-## 0.1.0-beta.4 (2022-08-10)
-
-### Features Added
-
-- [[#140]](https://github.com/Azure/azure-dev/pull/140) Add consistent resource abbreviations.
-
-### Bugs Fixed
-
-- [[#245]](https://github.com/Azure/azure-dev/issues/245) Fix Windows installer script modifying `PATH` environment variable to `REG_SZ` (reported by [@alexandair](https://github.com/alexandair))
-
-## 0.1.0-beta.3 (2022-07-28)
-
-### Features Added
-
-- [[#100]](https://github.com/Azure/azure-dev/pull/100) Add support for an optional `docker` section in service configuration to control advanced docker options.
-- [[#152]](https://github.com/Azure/azure-dev/pull/152) While provisioning in interactive mode (default), Azure resources are now logged to console as they are created.
-
-### Breaking Changes
-
-- [[#117]](https://github.com/Azure/azure-dev/issues/117) When specifying a custom module within a service the configuration key has been changed from `moduleName` to `module` and accepts a relative path to the infra module.
-
-### Bugs Fixed
-
-- [[#77]](https://github.com/Azure/azure-dev/issues/77) Use the correct command to log into the GitHub CLI in error messages. Thanks to community member [@TheEskhaton](https://github.com/TheEskhaton) for the fix!
-- [[#115]](https://github.com/Azure/azure-dev/issues/115) Fix deploy error when using a resource name with capital letters.
-
-### Other Changes
-
-- [[#188]](https://github.com/Azure/azure-dev/issues/188) Update the minimum Bicep version to `v0.8.9`.
-
-## 0.1.0-beta.2 (2022-07-13)
-
-### Bugs Fixed
-
-- Fixed an issue where passing `--help` to `azd` would result in an error message being printed to standard error before the help was printed.
-- [[#71]](https://github.com/Azure/azure-dev/issues/71) Fixed detection for disabled GitHub actions on new created repos.
-- [[#70]](https://github.com/Azure/azure-dev/issues/70) Ensure SWA app is in READY state after deployment completes
-- [[#53]](https://github.com/Azure/azure-dev/issues/53) SWA app is deployed to incorrect environment
-
-## 0.1.0-beta.1 (2022-07-11)
-
-Initial public release of the Azure Developer CLI.
+*Breaking Changes*
+* ...
diff --git a/cli/azd/CONTRIBUTING.md b/cli/azd/CONTRIBUTING.md
index 404836e3e69..a9115cf5536 100644
--- a/cli/azd/CONTRIBUTING.md
+++ b/cli/azd/CONTRIBUTING.md
@@ -1,108 +1,76 @@
-# Contributing to `azd`
+# Contributing to [project-title]
-Hi there 👋! Thank you for showing interest in contributing to `azd`.
+This project welcomes contributions and suggestions. Most contributions require you to agree to a
+Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
+the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
-In general, to make contributions a smooth and easy experience, we encourage the following:
+When you submit a pull request, a CLA bot will automatically determine whether you need to provide
+a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
+provided by the bot. You will only need to do this once across all repos using our CLA.
-- Check existing issues for [bugs][bug issues] or [enhancements][enhancement issues].
-- Open an issue if things aren't working as expected, or if an enhancement is being proposed.
-- Start a conversation on the issue if you are thinking of submitting a pull request.
-- Submit a pull request. The `azd` team will work with you to review the changes and provide feedback. Once the pull request is accepted, a member will merge the changes. Thank you for taking time out of your day to help improve our community!
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
+For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
+contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
-## Building `azd`
+ - [Code of Conduct](#coc)
+ - [Issues and Bugs](#issue)
+ - [Feature Requests](#feature)
+ - [Submission Guidelines](#submit)
-Prerequisites:
+## Code of Conduct
+Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
-- [Go](https://go.dev/dl/) 1.24
+## Found an Issue?
+If you find a bug in the source code or a mistake in the documentation, you can help us by
+[submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can
+[submit a Pull Request](#submit-pr) with a fix.
-Build:
+## Want a Feature?
+You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub
+Repository. If you would like to *implement* a new feature, please submit an issue with
+a proposal for your work first, to be sure that we can use it.
-```bash
-cd cli/azd
-go build
-```
+* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
-Run the newly produced `azd` or `azd.exe` binary:
+## Submission Guidelines
-- Unix-like systems: `./azd`
-- Windows: `.\azd.exe`
+### Submitting an Issue
+Before you submit an issue, search the archive, maybe your question was already answered.
-Run tests:
+If your issue appears to be a bug, and hasn't been reported, open a new issue.
+Help us to maximize the effort we can spend fixing issues and adding new
+features, by not reporting duplicate issues. Providing the following information will increase the
+chances of your issue being dealt with quickly:
-```bash
-go test ./... -short
-```
+* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
+* **Version** - what version is affected (e.g. 0.1.2)
+* **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you
+* **Browsers and Operating System** - is this a problem with all browsers?
+* **Reproduce the Error** - provide a live example or a unambiguous set of steps
+* **Related Issues** - has a similar issue been reported before?
+* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
+ causing the problem (line of code or commit)
-Run tests (including end-to-end [functional][functional tests] tests)
+You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/[organization-name]/[repository-name]/issues/new].
-```bash
-go test ./...
-```
+### Submitting a Pull Request (PR)
+Before you submit your Pull Request (PR) consider the following guidelines:
-Run cspell (install [cspell](https://cspell.org/)):
+* Search the repository (https://github.com/[organization-name]/[repository-name]/pulls) for an open or closed PR
+ that relates to your submission. You don't want to duplicate effort.
-```bash
-cspell lint "**/*.go" --relative --config ./.vscode/cspell.yaml
-```
+* Make your changes in a new git fork:
-Run linter (install [golangci-lint](https://golangci-lint.run/welcome/install/#local-installation)):
+* Commit your changes using a descriptive commit message
+* Push your fork to GitHub:
+* In GitHub, create a pull request
+* If we suggest changes then:
+ * Make the required updates.
+ * Rebase your fork and force push to your GitHub repository (this will update your Pull Request):
-```bash
-golangci-lint run ./...
-```
+ ```shell
+ git rebase master -i
+ git push -f
+ ```
-> Note: On Windows you may need to add `C:\Program Files\Git\usr\bin` to `%PATH%`
-
-### Debugging (with VSCode)
-
-If you don't have a preferred editor for Go code, we recommend [Visual Studio Code](https://code.visualstudio.com/Download).
-
-Launch and debug:
-
-1. Open VSCode in either `cli/azd` (preferred) or in the root directory.
-1. In VSCode, put a breakpoint on the line of code you would like to debug.
-1. Press F5. Alternatively: Select the "Run and Debug" side pane. With the launch task set to "Debug azd cli", click on the launch button.
-1. An interactive VSCode prompt should appear. Provide the args for running `azd` in this prompt window. Press enter when you're done.
-1. `azd` should now be running inside the VSCode terminal with the debugger attached.
-
-Launch `azd` separately, then attach:
-
-1. Set `AZD_DEBUG=true` in your shell. If this environment variable is set, `azd` will pause early in its startup process and allow you to attach to it.
-1. In VSCode, run the launch task "Attach to process".
-1. Select `azd` and press enter.
-1. VSCode debugger should now be attached to the running `azd` process.
-1. In the shell with `azd` running, press enter to resume execution.
-
-> Tip: Use the VSCode terminal to perform all `azd` build and run commands.
-
-## Submitting a change
-
-1. Create a new branch: `git checkout -b my-branch-name`
-1. Make your change, add tests, and ensure tests pass
-1. Submit a pull request: `gh pr create --web` (install [gh cli][gh cli] if needed). Select "Create a fork" to set up a fork for the first time if prompted for.
-
-## Troubleshooting
-
-### Access is denied
-
-Windows Security may block execution of unsigned .exe files. This may happen when validating unsigned .exe files produced in
-a PR build.
-
-```bash
-> azd version
-Access is denied.
-```
-
-To fix:
-
-1. Run `where azd` (cmd) or `(Get-Command azd).Source` (PowerShell) to get the command path
-1. Click the Start button and type `Windows Security`, select and launch the "Windows Security" application
-1. Select `Virus & threat protection` tab on the left side of the window
-1. Click the `Manage settings` link under `Virus & threat protection settings`
-1. Scroll down in the window to the `Exclusions` heading and click the `Add or remove exclusions link`
-1. Select `Add an exclusion` and add the path to the exe from step 1
-
-[bug issues]: https://github.com/Azure/azure-dev/issues?q=is%3Aopen+is%3Aissue+label%3Abug
-[enhancement issues]: https://github.com/Azure/azure-dev/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement
-[functional tests]: https://github.com/Azure/azure-dev/tree/main/cli/azd/test/functional
-[gh cli]: https://github.com/cli/cli?tab=readme-ov-file#installation
+That's it! Thank you for your contribution!
diff --git a/cli/azd/LICENSE.md b/cli/azd/LICENSE.md
new file mode 100644
index 00000000000..79656060de0
--- /dev/null
+++ b/cli/azd/LICENSE.md
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
\ No newline at end of file
diff --git a/cli/azd/README.md b/cli/azd/README.md
index 544d89b52ea..35cdb75290b 100644
--- a/cli/azd/README.md
+++ b/cli/azd/README.md
@@ -1,9 +1,22 @@
-# Azure Developer CLI (azd)
+# [Spring PetClinic Sample Application](https://github.com/spring-projects/spring-petclinic) using a full set of Azure solutions
-## VS Code
+* [Azure AppService](https://azure.microsoft.com/en-us/products/app-service/) for app hosting,
+* [Azure Database for MySQL](https://azure.microsoft.com/en-us/products/mysql/) for storage (optional, default is H2 in-memory database),
+* [Azure Monitor](https://azure.microsoft.com/en-us/products/monitor/)([Application Insights](https://learn.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview?tabs=net)) for monitoring and logging.
+* [Managed Identity](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview) for passwordless secure connections.
+* [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview)
-Install Go extension https://marketplace.visualstudio.com/items?itemName=golang.Go
+## Prerequisites
-## Contribute
+The following prerequisites are required to use this application. Please ensure that you have them all installed locally.
-See [CONTRIBUTING.md](./CONTRIBUTING.md) for information on contributing.
+* [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
+* Java 11 or later
+
+## Tutorial
+
+A blog post tutorial for this application can be found [here](https://techcommunity.microsoft.com/t5/apps-on-azure-blog/deploy-intelligent-springboot-apps-using-azure-openai-and-azure/ba-p/4257130).
+
+Clone the code using `azd init -t Azure-Samples/SpringBoot-Petclinic-AI-Chat-on-App-Service`.
+
+Deploy with AZD using `azd up`. By default, an in-memory database (H2) is used. To deploy and use an Azure MySQL Database, switch your Spring profile from h2 to mysql and uncomment the mysql database creation code in the bicep files under the `infra/` directory.
diff --git a/cli/azd/azure.yaml b/cli/azd/azure.yaml
new file mode 100644
index 00000000000..9e27a798068
--- /dev/null
+++ b/cli/azd/azure.yaml
@@ -0,0 +1,9 @@
+# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
+
+name: spring-petclinic-appservice-ai
+services:
+ petclinic:
+ project: .
+ dist: target
+ language: java
+ host: appservice
diff --git a/cli/azd/infra/abbreviations.json b/cli/azd/infra/abbreviations.json
new file mode 100644
index 00000000000..a4fc9dfed44
--- /dev/null
+++ b/cli/azd/infra/abbreviations.json
@@ -0,0 +1,135 @@
+{
+ "analysisServicesServers": "as",
+ "apiManagementService": "apim-",
+ "appConfigurationConfigurationStores": "appcs-",
+ "appManagedEnvironments": "cae-",
+ "appContainerApps": "ca-",
+ "authorizationPolicyDefinitions": "policy-",
+ "automationAutomationAccounts": "aa-",
+ "blueprintBlueprints": "bp-",
+ "blueprintBlueprintsArtifacts": "bpa-",
+ "cacheRedis": "redis-",
+ "cdnProfiles": "cdnp-",
+ "cdnProfilesEndpoints": "cdne-",
+ "cognitiveServicesAccounts": "cog-",
+ "cognitiveServicesFormRecognizer": "cog-fr-",
+ "cognitiveServicesTextAnalytics": "cog-ta-",
+ "computeAvailabilitySets": "avail-",
+ "computeCloudServices": "cld-",
+ "computeDiskEncryptionSets": "des",
+ "computeDisks": "disk",
+ "computeDisksOs": "osdisk",
+ "computeGalleries": "gal",
+ "computeSnapshots": "snap-",
+ "computeVirtualMachines": "vm",
+ "computeVirtualMachineScaleSets": "vmss-",
+ "containerInstanceContainerGroups": "ci",
+ "containerRegistryRegistries": "cr",
+ "containerServiceManagedClusters": "aks-",
+ "databricksWorkspaces": "dbw-",
+ "dataFactoryFactories": "adf-",
+ "dataLakeAnalyticsAccounts": "dla",
+ "dataLakeStoreAccounts": "dls",
+ "dataMigrationServices": "dms-",
+ "dBforMySQLServers": "mysql-",
+ "dBforPostgreSQLServers": "psql-",
+ "devicesIotHubs": "iot-",
+ "devicesProvisioningServices": "provs-",
+ "devicesProvisioningServicesCertificates": "pcert-",
+ "documentDBDatabaseAccounts": "cosmos-",
+ "eventGridDomains": "evgd-",
+ "eventGridDomainsTopics": "evgt-",
+ "eventGridEventSubscriptions": "evgs-",
+ "eventHubNamespaces": "evhns-",
+ "eventHubNamespacesEventHubs": "evh-",
+ "hdInsightClustersHadoop": "hadoop-",
+ "hdInsightClustersHbase": "hbase-",
+ "hdInsightClustersKafka": "kafka-",
+ "hdInsightClustersMl": "mls-",
+ "hdInsightClustersSpark": "spark-",
+ "hdInsightClustersStorm": "storm-",
+ "hybridComputeMachines": "arcs-",
+ "insightsActionGroups": "ag-",
+ "insightsComponents": "appi-",
+ "keyVaultVaults": "kv-",
+ "kubernetesConnectedClusters": "arck",
+ "kustoClusters": "dec",
+ "kustoClustersDatabases": "dedb",
+ "logicIntegrationAccounts": "ia-",
+ "logicWorkflows": "logic-",
+ "machineLearningServicesWorkspaces": "mlw-",
+ "managedIdentityUserAssignedIdentities": "id-",
+ "managementManagementGroups": "mg-",
+ "migrateAssessmentProjects": "migr-",
+ "networkApplicationGateways": "agw-",
+ "networkApplicationSecurityGroups": "asg-",
+ "networkAzureFirewalls": "afw-",
+ "networkBastionHosts": "bas-",
+ "networkConnections": "con-",
+ "networkDnsZones": "dnsz-",
+ "networkExpressRouteCircuits": "erc-",
+ "networkFirewallPolicies": "afwp-",
+ "networkFirewallPoliciesWebApplication": "waf",
+ "networkFirewallPoliciesRuleGroups": "wafrg",
+ "networkFrontDoors": "fd-",
+ "networkFrontdoorWebApplicationFirewallPolicies": "fdfp-",
+ "networkLoadBalancersExternal": "lbe-",
+ "networkLoadBalancersInternal": "lbi-",
+ "networkLoadBalancersInboundNatRules": "rule-",
+ "networkLocalNetworkGateways": "lgw-",
+ "networkNatGateways": "ng-",
+ "networkNetworkInterfaces": "nic-",
+ "networkNetworkSecurityGroups": "nsg-",
+ "networkNetworkSecurityGroupsSecurityRules": "nsgsr-",
+ "networkNetworkWatchers": "nw-",
+ "networkPrivateDnsZones": "pdnsz-",
+ "networkPrivateLinkServices": "pl-",
+ "networkPublicIPAddresses": "pip-",
+ "networkPublicIPPrefixes": "ippre-",
+ "networkRouteFilters": "rf-",
+ "networkRouteTables": "rt-",
+ "networkRouteTablesRoutes": "udr-",
+ "networkTrafficManagerProfiles": "traf-",
+ "networkVirtualNetworkGateways": "vgw-",
+ "networkVirtualNetworks": "vnet-",
+ "networkVirtualNetworksSubnets": "snet-",
+ "networkVirtualNetworksVirtualNetworkPeerings": "peer-",
+ "networkVirtualWans": "vwan-",
+ "networkVpnGateways": "vpng-",
+ "networkVpnGatewaysVpnConnections": "vcn-",
+ "networkVpnGatewaysVpnSites": "vst-",
+ "notificationHubsNamespaces": "ntfns-",
+ "notificationHubsNamespacesNotificationHubs": "ntf-",
+ "operationalInsightsWorkspaces": "log-",
+ "portalDashboards": "dash-",
+ "powerBIDedicatedCapacities": "pbi-",
+ "purviewAccounts": "pview-",
+ "recoveryServicesVaults": "rsv-",
+ "resourcesResourceGroups": "rg-",
+ "searchSearchServices": "srch-",
+ "serviceBusNamespaces": "sb-",
+ "serviceBusNamespacesQueues": "sbq-",
+ "serviceBusNamespacesTopics": "sbt-",
+ "serviceEndPointPolicies": "se-",
+ "serviceFabricClusters": "sf-",
+ "signalRServiceSignalR": "sigr",
+ "sqlManagedInstances": "sqlmi-",
+ "sqlServers": "sql-",
+ "sqlServersDataWarehouse": "sqldw-",
+ "sqlServersDatabases": "sqldb-",
+ "sqlServersDatabasesStretch": "sqlstrdb-",
+ "storageStorageAccounts": "st",
+ "storageStorageAccountsVm": "stvm",
+ "storSimpleManagers": "ssimp",
+ "streamAnalyticsCluster": "asa-",
+ "synapseWorkspaces": "syn",
+ "synapseWorkspacesAnalyticsWorkspaces": "synw",
+ "synapseWorkspacesSqlPoolsDedicated": "syndp",
+ "synapseWorkspacesSqlPoolsSpark": "synsp",
+ "timeSeriesInsightsEnvironments": "tsi-",
+ "webServerFarms": "plan-",
+ "webSitesAppService": "app-",
+ "webSitesAppServiceEnvironment": "ase-",
+ "webSitesFunctions": "func-",
+ "webStaticSites": "stapp-"
+}
\ No newline at end of file
diff --git a/cli/azd/infra/app/app.bicep b/cli/azd/infra/app/app.bicep
new file mode 100644
index 00000000000..25e41adaa59
--- /dev/null
+++ b/cli/azd/infra/app/app.bicep
@@ -0,0 +1,50 @@
+param name string
+param location string = resourceGroup().location
+param tags object = {}
+
+param allowedOrigins array = []
+param appCommandLine string = ''
+param applicationInsightsName string = ''
+param appServicePlanId string
+param appSettings object = {}
+param keyVaultName string
+param serviceName string = 'petclinic'
+param managedIdentityID string
+param managedIdentityName string
+
+@description('JVM runtime options. Use this instead of defining JAVA_OPTS manually on appSettings.')
+param javaRuntimeOptions array = []
+
+// applicationinsights-runtime-attach (and other plugins) that uses runtime attach
+// require allowAttachSelf to be enabled on App Service. Otherwise, plugins will fail to attach
+// on App Service.
+var defaultJavaRuntimeOptions = [ '-Djdk.attach.allowAttachSelf=true' ]
+
+module app '../core/host/appservice.bicep' = {
+ name: '${name}-app-module'
+ params: {
+ userAssignedIdentityID: managedIdentityID
+ name: name
+ location: location
+ tags: union(tags, { 'azd-service-name': serviceName })
+ allowedOrigins: allowedOrigins
+ appCommandLine: appCommandLine
+ applicationInsightsName: applicationInsightsName
+ appServicePlanId: appServicePlanId
+ appSettings: union(appSettings, {
+ JAVA_OPTS: join(
+ concat(
+ javaRuntimeOptions,
+ defaultJavaRuntimeOptions),
+ ' ')
+ })
+ keyVaultName: keyVaultName
+ runtimeName: 'java'
+ runtimeVersion: '11-java11'
+ scmDoBuildDuringDeployment: true
+ }
+}
+
+//output APP_IDENTITY_PRINCIPAL_ID string = app.outputs.identityPrincipalId
+output APP_NAME string = app.outputs.name
+output APP_URI string = app.outputs.uri
diff --git a/cli/azd/infra/core/database/mysql/mysql-db.bicep b/cli/azd/infra/core/database/mysql/mysql-db.bicep
new file mode 100644
index 00000000000..0a157cffdf6
--- /dev/null
+++ b/cli/azd/infra/core/database/mysql/mysql-db.bicep
@@ -0,0 +1,51 @@
+/*param serverName string
+param databaseName string
+param location string = resourceGroup().location
+param tags object = {}
+
+param keyVaultName string
+@description('Database administrator login name')
+@minLength(1)
+param serverAdminName string
+
+// this is not the password, but the key used to load password from Key Vault
+#disable-next-line secure-secrets-in-params
+param serverAdminPasswordKey string = 'MYSQL-PASS'
+
+@description('Database administrator password')
+@minLength(8)
+@secure()
+param serverAdminPassword string
+
+// The database server
+module server 'mysql-server.bicep' = {
+ name: 'mysql-server'
+ params: {
+ name: serverName
+ location: location
+ tags: tags
+ adminName: serverAdminName
+ adminPassword: serverAdminPassword
+ adminPasswordKey: serverAdminPasswordKey
+ keyVaultName: keyVaultName
+ }
+}
+
+resource database 'Microsoft.DBforMySQL/flexibleServers/databases@2021-05-01' = {
+ name: '${serverName}/${databaseName}'
+ properties: {
+ charset: 'utf8'
+ collation: 'utf8_general_ci'
+ }
+
+ dependsOn: [
+ server
+ ]
+}
+
+// this is not the password, but the key used to load password from Key Vault
+#disable-next-line outputs-should-not-contain-secrets
+output serverAdminPasswordKey string = serverAdminPasswordKey
+output databaseName string = databaseName
+output endpoint string = 'jdbc:mysql://${server.outputs.fullyQualifiedDomainName}:3306/${databaseName}?useSSL=true&requireSSL=false'
+*/
diff --git a/cli/azd/infra/core/database/mysql/mysql-server.bicep b/cli/azd/infra/core/database/mysql/mysql-server.bicep
new file mode 100644
index 00000000000..39f8c1d99f9
--- /dev/null
+++ b/cli/azd/infra/core/database/mysql/mysql-server.bicep
@@ -0,0 +1,123 @@
+/*
+@description('Server Name for Azure database for MySQL')
+param name string
+@description('Location for all resources.')
+param location string = resourceGroup().location
+param tags object = {}
+
+param keyVaultName string
+
+@description('Database administrator login name')
+@minLength(1)
+param adminName string = 'mySqlAdmin'
+
+// this is not the password, but the key used to load password from Key Vault
+#disable-next-line secure-secrets-in-params
+param adminPasswordKey string = 'MYSQL-PASS'
+
+@description('Database administrator password')
+@minLength(8)
+@secure()
+param adminPassword string
+
+@description('Azure database for MySQL sku name ')
+param skuName string = 'Standard_B1s'
+
+@allowed([
+ 'Enabled'
+ 'Disabled'
+])
+@description('Enable Storage Auto Grow or not')
+param autoGrow string = 'Enabled'
+
+@description('Azure database for MySQL storage Size ')
+param storageSizeGB int = 20
+
+@description('Azure database for MySQL storage Iops')
+param storageIops int = 360
+
+@description('Azure database for MySQL pricing tier')
+@allowed([
+ 'GeneralPurpose'
+ 'MemoryOptimized'
+ 'Burstable'
+])
+param skuTier string = 'Burstable'
+
+@description('MySQL version')
+@allowed([
+ '5.7'
+ '8.0.21'
+])
+param version string = '8.0.21'
+
+@description('MySQL Server backup retention days')
+param backupRetentionDays int = 7
+
+@description('Geo-Redundant Backup setting')
+param geoRedundantBackup string = 'Disabled'
+
+@allowed([
+ 'Disabled'
+ 'ZoneRedundant'
+ 'SameZone'
+])
+param highAvailabilityMode string = 'Disabled'
+
+resource server 'Microsoft.DBforMySQL/flexibleServers@2021-05-01' = {
+ name: name
+ location: location
+ tags: tags
+ sku: {
+ name: skuName
+ tier: skuTier
+ }
+ properties: {
+ administratorLogin: adminName
+ administratorLoginPassword: adminPassword
+ storage: {
+ autoGrow: autoGrow
+ iops: storageIops
+ storageSizeGB: storageSizeGB
+ }
+ createMode: 'Default'
+ version: version
+ backup: {
+ backupRetentionDays: backupRetentionDays
+ geoRedundantBackup: geoRedundantBackup
+ }
+ highAvailability: {
+ mode: highAvailabilityMode
+ }
+ }
+}
+
+resource firewallRuleAllowAllAzureIps 'Microsoft.DBforMySQL/flexibleServers/firewallRules@2021-05-01' = {
+ parent: server
+ name: 'AllowAzureIPs'
+ properties: {
+ startIpAddress: '0.0.0.0'
+ endIpAddress: '0.0.0.0'
+ }
+}
+
+resource mySqlAdminPasswordSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = {
+ parent: keyVault
+ name: adminPasswordKey
+ properties: {
+ value: adminPassword
+ }
+}
+
+resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = {
+ name: keyVaultName
+}
+
+output name string = server.name
+output adminName string = adminName
+// this is not the password, but the key used to load password from Key Vault
+#disable-next-line outputs-should-not-contain-secrets
+output adminPasswordKey string = adminPasswordKey
+output fullyQualifiedDomainName string = server.properties.fullyQualifiedDomainName
+output endpoint string = 'jdbc:mysql://${server.properties.fullyQualifiedDomainName}:3306/?useSSL=true&requireSSL=false'
+*/
diff --git a/cli/azd/infra/core/host/appservice.bicep b/cli/azd/infra/core/host/appservice.bicep
new file mode 100644
index 00000000000..c26bf864fd8
--- /dev/null
+++ b/cli/azd/infra/core/host/appservice.bicep
@@ -0,0 +1,103 @@
+param name string
+param location string = resourceGroup().location
+param tags object = {}
+
+// Reference Properties
+param applicationInsightsName string = ''
+param appServicePlanId string
+param keyVaultName string = ''
+// Runtime Properties
+@allowed([
+ 'dotnet', 'dotnetcore', 'dotnet-isolated', 'node', 'python', 'java', 'powershell', 'custom'
+])
+param runtimeName string
+param runtimeNameAndVersion string = '${runtimeName}|${runtimeVersion}'
+param runtimeVersion string
+
+// Microsoft.Web/sites Properties
+param kind string = 'app,linux'
+
+// Microsoft.Web/sites/config
+param allowedOrigins array = []
+param alwaysOn bool = true
+param appCommandLine string = ''
+param appSettings object = {}
+param clientAffinityEnabled bool = false
+param enableOryxBuild bool = contains(kind, 'linux')
+param functionAppScaleLimit int = -1
+param linuxFxVersion string = runtimeNameAndVersion
+param minimumElasticInstanceCount int = -1
+param numberOfWorkers int = -1
+param scmDoBuildDuringDeployment bool = false
+param use32BitWorkerProcess bool = false
+param userAssignedIdentityID string
+
+
+
+resource appService 'Microsoft.Web/sites@2022-03-01' = {
+ name: name
+ location: location
+ identity: {
+ type: 'UserAssigned'
+ userAssignedIdentities: {'${userAssignedIdentityID}': {}}
+ }
+ tags: tags
+ kind: kind
+ properties: {
+ serverFarmId: appServicePlanId
+ siteConfig: {
+ linuxFxVersion: linuxFxVersion
+ alwaysOn: alwaysOn
+ ftpsState: 'FtpsOnly'
+ appCommandLine: appCommandLine
+ numberOfWorkers: numberOfWorkers != -1 ? numberOfWorkers : null
+ minimumElasticInstanceCount: minimumElasticInstanceCount != -1 ? minimumElasticInstanceCount : null
+ use32BitWorkerProcess: use32BitWorkerProcess
+ functionAppScaleLimit: functionAppScaleLimit != -1 ? functionAppScaleLimit : null
+ cors: {
+ allowedOrigins: union([ 'https://portal.azure.com', 'https://ms.portal.azure.com' ], allowedOrigins)
+ }
+ }
+ clientAffinityEnabled: clientAffinityEnabled
+ httpsOnly: true
+ }
+
+ resource configAppSettings 'config' = {
+ name: 'appsettings'
+ properties: union(appSettings,
+ {
+ SCM_DO_BUILD_DURING_DEPLOYMENT: string(scmDoBuildDuringDeployment)
+ ENABLE_ORYX_BUILD: string(enableOryxBuild)
+ },
+ !empty(applicationInsightsName) ? { APPLICATIONINSIGHTS_CONNECTION_STRING: applicationInsights.properties.ConnectionString } : {},
+ !empty(keyVaultName) ? { AZURE_KEY_VAULT_ENDPOINT: keyVault.properties.vaultUri } : {})
+ }
+
+ resource configLogs 'config' = {
+ name: 'logs'
+ properties: {
+ applicationLogs: { fileSystem: { level: 'Verbose' } }
+ detailedErrorMessages: { enabled: true }
+ failedRequestsTracing: { enabled: true }
+ httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } }
+ }
+ dependsOn: [
+ configAppSettings
+ ]
+ }
+}
+
+resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = if (!(empty(keyVaultName))) {
+ name: keyVaultName
+}
+
+
+
+resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = if (!empty(applicationInsightsName)) {
+ name: applicationInsightsName
+}
+
+//output identityPrincipalId string = appService.identity.principalId
+output name string = appService.name
+output uri string = 'https://${appService.properties.defaultHostName}'
+
diff --git a/cli/azd/infra/core/host/appserviceplan.bicep b/cli/azd/infra/core/host/appserviceplan.bicep
new file mode 100644
index 00000000000..69c35d78ece
--- /dev/null
+++ b/cli/azd/infra/core/host/appserviceplan.bicep
@@ -0,0 +1,20 @@
+param name string
+param location string = resourceGroup().location
+param tags object = {}
+
+param kind string = ''
+param reserved bool = true
+param sku object
+
+resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
+ name: name
+ location: location
+ tags: tags
+ sku: sku
+ kind: kind
+ properties: {
+ reserved: reserved
+ }
+}
+
+output id string = appServicePlan.id
diff --git a/cli/azd/infra/core/monitor/applicationinsights-dashboard.bicep b/cli/azd/infra/core/monitor/applicationinsights-dashboard.bicep
new file mode 100644
index 00000000000..b7af2c1a106
--- /dev/null
+++ b/cli/azd/infra/core/monitor/applicationinsights-dashboard.bicep
@@ -0,0 +1,1235 @@
+param name string
+param applicationInsightsName string
+param location string = resourceGroup().location
+param tags object = {}
+
+// 2020-09-01-preview because that is the latest valid version
+resource applicationInsightsDashboard 'Microsoft.Portal/dashboards@2020-09-01-preview' = {
+ name: name
+ location: location
+ tags: tags
+ properties: {
+ lenses: [
+ {
+ order: 0
+ parts: [
+ {
+ position: {
+ x: 0
+ y: 0
+ colSpan: 2
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'id'
+ value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ {
+ name: 'Version'
+ value: '1.0'
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/AppInsightsExtension/PartType/AspNetOverviewPinnedPart'
+ asset: {
+ idInputName: 'id'
+ type: 'ApplicationInsights'
+ }
+ defaultMenuItemId: 'overview'
+ }
+ }
+ {
+ position: {
+ x: 2
+ y: 0
+ colSpan: 1
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'ComponentId'
+ value: {
+ Name: applicationInsights.name
+ SubscriptionId: subscription().subscriptionId
+ ResourceGroup: resourceGroup().name
+ }
+ }
+ {
+ name: 'Version'
+ value: '1.0'
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/AppInsightsExtension/PartType/ProactiveDetectionAsyncPart'
+ asset: {
+ idInputName: 'ComponentId'
+ type: 'ApplicationInsights'
+ }
+ defaultMenuItemId: 'ProactiveDetection'
+ }
+ }
+ {
+ position: {
+ x: 3
+ y: 0
+ colSpan: 1
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'ComponentId'
+ value: {
+ Name: applicationInsights.name
+ SubscriptionId: subscription().subscriptionId
+ ResourceGroup: resourceGroup().name
+ }
+ }
+ {
+ name: 'ResourceId'
+ value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/AppInsightsExtension/PartType/QuickPulseButtonSmallPart'
+ asset: {
+ idInputName: 'ComponentId'
+ type: 'ApplicationInsights'
+ }
+ }
+ }
+ {
+ position: {
+ x: 4
+ y: 0
+ colSpan: 1
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'ComponentId'
+ value: {
+ Name: applicationInsights.name
+ SubscriptionId: subscription().subscriptionId
+ ResourceGroup: resourceGroup().name
+ }
+ }
+ {
+ name: 'TimeContext'
+ value: {
+ durationMs: 86400000
+ endTime: null
+ createdTime: '2018-05-04T01:20:33.345Z'
+ isInitialTime: true
+ grain: 1
+ useDashboardTimeRange: false
+ }
+ }
+ {
+ name: 'Version'
+ value: '1.0'
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/AppInsightsExtension/PartType/AvailabilityNavButtonPart'
+ asset: {
+ idInputName: 'ComponentId'
+ type: 'ApplicationInsights'
+ }
+ }
+ }
+ {
+ position: {
+ x: 5
+ y: 0
+ colSpan: 1
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'ComponentId'
+ value: {
+ Name: applicationInsights.name
+ SubscriptionId: subscription().subscriptionId
+ ResourceGroup: resourceGroup().name
+ }
+ }
+ {
+ name: 'TimeContext'
+ value: {
+ durationMs: 86400000
+ endTime: null
+ createdTime: '2018-05-08T18:47:35.237Z'
+ isInitialTime: true
+ grain: 1
+ useDashboardTimeRange: false
+ }
+ }
+ {
+ name: 'ConfigurationId'
+ value: '78ce933e-e864-4b05-a27b-71fd55a6afad'
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/AppInsightsExtension/PartType/AppMapButtonPart'
+ asset: {
+ idInputName: 'ComponentId'
+ type: 'ApplicationInsights'
+ }
+ }
+ }
+ {
+ position: {
+ x: 0
+ y: 1
+ colSpan: 3
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: []
+ type: 'Extension/HubsExtension/PartType/MarkdownPart'
+ settings: {
+ content: {
+ settings: {
+ content: '# Usage'
+ title: ''
+ subtitle: ''
+ }
+ }
+ }
+ }
+ }
+ {
+ position: {
+ x: 3
+ y: 1
+ colSpan: 1
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'ComponentId'
+ value: {
+ Name: applicationInsights.name
+ SubscriptionId: subscription().subscriptionId
+ ResourceGroup: resourceGroup().name
+ }
+ }
+ {
+ name: 'TimeContext'
+ value: {
+ durationMs: 86400000
+ endTime: null
+ createdTime: '2018-05-04T01:22:35.782Z'
+ isInitialTime: true
+ grain: 1
+ useDashboardTimeRange: false
+ }
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/AppInsightsExtension/PartType/UsageUsersOverviewPart'
+ asset: {
+ idInputName: 'ComponentId'
+ type: 'ApplicationInsights'
+ }
+ }
+ }
+ {
+ position: {
+ x: 4
+ y: 1
+ colSpan: 3
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: []
+ type: 'Extension/HubsExtension/PartType/MarkdownPart'
+ settings: {
+ content: {
+ settings: {
+ content: '# Reliability'
+ title: ''
+ subtitle: ''
+ }
+ }
+ }
+ }
+ }
+ {
+ position: {
+ x: 7
+ y: 1
+ colSpan: 1
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'ResourceId'
+ value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ {
+ name: 'DataModel'
+ value: {
+ version: '1.0.0'
+ timeContext: {
+ durationMs: 86400000
+ createdTime: '2018-05-04T23:42:40.072Z'
+ isInitialTime: false
+ grain: 1
+ useDashboardTimeRange: false
+ }
+ }
+ isOptional: true
+ }
+ {
+ name: 'ConfigurationId'
+ value: '8a02f7bf-ac0f-40e1-afe9-f0e72cfee77f'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/AppInsightsExtension/PartType/CuratedBladeFailuresPinnedPart'
+ isAdapter: true
+ asset: {
+ idInputName: 'ResourceId'
+ type: 'ApplicationInsights'
+ }
+ defaultMenuItemId: 'failures'
+ }
+ }
+ {
+ position: {
+ x: 8
+ y: 1
+ colSpan: 3
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: []
+ type: 'Extension/HubsExtension/PartType/MarkdownPart'
+ settings: {
+ content: {
+ settings: {
+ content: '# Responsiveness\r\n'
+ title: ''
+ subtitle: ''
+ }
+ }
+ }
+ }
+ }
+ {
+ position: {
+ x: 11
+ y: 1
+ colSpan: 1
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'ResourceId'
+ value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ {
+ name: 'DataModel'
+ value: {
+ version: '1.0.0'
+ timeContext: {
+ durationMs: 86400000
+ createdTime: '2018-05-04T23:43:37.804Z'
+ isInitialTime: false
+ grain: 1
+ useDashboardTimeRange: false
+ }
+ }
+ isOptional: true
+ }
+ {
+ name: 'ConfigurationId'
+ value: '2a8ede4f-2bee-4b9c-aed9-2db0e8a01865'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/AppInsightsExtension/PartType/CuratedBladePerformancePinnedPart'
+ isAdapter: true
+ asset: {
+ idInputName: 'ResourceId'
+ type: 'ApplicationInsights'
+ }
+ defaultMenuItemId: 'performance'
+ }
+ }
+ {
+ position: {
+ x: 12
+ y: 1
+ colSpan: 3
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: []
+ type: 'Extension/HubsExtension/PartType/MarkdownPart'
+ settings: {
+ content: {
+ settings: {
+ content: '# Browser'
+ title: ''
+ subtitle: ''
+ }
+ }
+ }
+ }
+ }
+ {
+ position: {
+ x: 15
+ y: 1
+ colSpan: 1
+ rowSpan: 1
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'ComponentId'
+ value: {
+ Name: applicationInsights.name
+ SubscriptionId: subscription().subscriptionId
+ ResourceGroup: resourceGroup().name
+ }
+ }
+ {
+ name: 'MetricsExplorerJsonDefinitionId'
+ value: 'BrowserPerformanceTimelineMetrics'
+ }
+ {
+ name: 'TimeContext'
+ value: {
+ durationMs: 86400000
+ createdTime: '2018-05-08T12:16:27.534Z'
+ isInitialTime: false
+ grain: 1
+ useDashboardTimeRange: false
+ }
+ }
+ {
+ name: 'CurrentFilter'
+ value: {
+ eventTypes: [
+ 4
+ 1
+ 3
+ 5
+ 2
+ 6
+ 13
+ ]
+ typeFacets: {}
+ isPermissive: false
+ }
+ }
+ {
+ name: 'id'
+ value: {
+ Name: applicationInsights.name
+ SubscriptionId: subscription().subscriptionId
+ ResourceGroup: resourceGroup().name
+ }
+ }
+ {
+ name: 'Version'
+ value: '1.0'
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/AppInsightsExtension/PartType/MetricsExplorerBladePinnedPart'
+ asset: {
+ idInputName: 'ComponentId'
+ type: 'ApplicationInsights'
+ }
+ defaultMenuItemId: 'browser'
+ }
+ }
+ {
+ position: {
+ x: 0
+ y: 2
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'sessions/count'
+ aggregationType: 5
+ namespace: 'microsoft.insights/components/kusto'
+ metricVisualization: {
+ displayName: 'Sessions'
+ color: '#47BDF5'
+ }
+ }
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'users/count'
+ aggregationType: 5
+ namespace: 'microsoft.insights/components/kusto'
+ metricVisualization: {
+ displayName: 'Users'
+ color: '#7E58FF'
+ }
+ }
+ ]
+ title: 'Unique sessions and users'
+ visualization: {
+ chartType: 2
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ openBladeOnClick: {
+ openBlade: true
+ destinationBlade: {
+ extensionName: 'HubsExtension'
+ bladeName: 'ResourceMenuBlade'
+ parameters: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ menuid: 'segmentationUsers'
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ {
+ position: {
+ x: 4
+ y: 2
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'requests/failed'
+ aggregationType: 7
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Failed requests'
+ color: '#EC008C'
+ }
+ }
+ ]
+ title: 'Failed requests'
+ visualization: {
+ chartType: 3
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ openBladeOnClick: {
+ openBlade: true
+ destinationBlade: {
+ extensionName: 'HubsExtension'
+ bladeName: 'ResourceMenuBlade'
+ parameters: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ menuid: 'failures'
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ {
+ position: {
+ x: 8
+ y: 2
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'requests/duration'
+ aggregationType: 4
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Server response time'
+ color: '#00BCF2'
+ }
+ }
+ ]
+ title: 'Server response time'
+ visualization: {
+ chartType: 2
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ openBladeOnClick: {
+ openBlade: true
+ destinationBlade: {
+ extensionName: 'HubsExtension'
+ bladeName: 'ResourceMenuBlade'
+ parameters: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ menuid: 'performance'
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ {
+ position: {
+ x: 12
+ y: 2
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'browserTimings/networkDuration'
+ aggregationType: 4
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Page load network connect time'
+ color: '#7E58FF'
+ }
+ }
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'browserTimings/processingDuration'
+ aggregationType: 4
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Client processing time'
+ color: '#44F1C8'
+ }
+ }
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'browserTimings/sendDuration'
+ aggregationType: 4
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Send request time'
+ color: '#EB9371'
+ }
+ }
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'browserTimings/receiveDuration'
+ aggregationType: 4
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Receiving response time'
+ color: '#0672F1'
+ }
+ }
+ ]
+ title: 'Average page load time breakdown'
+ visualization: {
+ chartType: 3
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ {
+ position: {
+ x: 0
+ y: 5
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'availabilityResults/availabilityPercentage'
+ aggregationType: 4
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Availability'
+ color: '#47BDF5'
+ }
+ }
+ ]
+ title: 'Average availability'
+ visualization: {
+ chartType: 3
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ openBladeOnClick: {
+ openBlade: true
+ destinationBlade: {
+ extensionName: 'HubsExtension'
+ bladeName: 'ResourceMenuBlade'
+ parameters: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ menuid: 'availability'
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ {
+ position: {
+ x: 4
+ y: 5
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'exceptions/server'
+ aggregationType: 7
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Server exceptions'
+ color: '#47BDF5'
+ }
+ }
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'dependencies/failed'
+ aggregationType: 7
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Dependency failures'
+ color: '#7E58FF'
+ }
+ }
+ ]
+ title: 'Server exceptions and Dependency failures'
+ visualization: {
+ chartType: 2
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ {
+ position: {
+ x: 8
+ y: 5
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'performanceCounters/processorCpuPercentage'
+ aggregationType: 4
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Processor time'
+ color: '#47BDF5'
+ }
+ }
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'performanceCounters/processCpuPercentage'
+ aggregationType: 4
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Process CPU'
+ color: '#7E58FF'
+ }
+ }
+ ]
+ title: 'Average processor and process CPU utilization'
+ visualization: {
+ chartType: 2
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ {
+ position: {
+ x: 12
+ y: 5
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'exceptions/browser'
+ aggregationType: 7
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Browser exceptions'
+ color: '#47BDF5'
+ }
+ }
+ ]
+ title: 'Browser exceptions'
+ visualization: {
+ chartType: 2
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ {
+ position: {
+ x: 0
+ y: 8
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'availabilityResults/count'
+ aggregationType: 7
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Availability test results count'
+ color: '#47BDF5'
+ }
+ }
+ ]
+ title: 'Availability test results count'
+ visualization: {
+ chartType: 2
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ {
+ position: {
+ x: 4
+ y: 8
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'performanceCounters/processIOBytesPerSecond'
+ aggregationType: 4
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Process IO rate'
+ color: '#47BDF5'
+ }
+ }
+ ]
+ title: 'Average process I/O rate'
+ visualization: {
+ chartType: 2
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ {
+ position: {
+ x: 8
+ y: 8
+ colSpan: 4
+ rowSpan: 3
+ }
+ metadata: {
+ inputs: [
+ {
+ name: 'options'
+ value: {
+ chart: {
+ metrics: [
+ {
+ resourceMetadata: {
+ id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}'
+ }
+ name: 'performanceCounters/memoryAvailableBytes'
+ aggregationType: 4
+ namespace: 'microsoft.insights/components'
+ metricVisualization: {
+ displayName: 'Available memory'
+ color: '#47BDF5'
+ }
+ }
+ ]
+ title: 'Average available memory'
+ visualization: {
+ chartType: 2
+ legendVisualization: {
+ isVisible: true
+ position: 2
+ hideSubtitle: false
+ }
+ axisVisualization: {
+ x: {
+ isVisible: true
+ axisType: 2
+ }
+ y: {
+ isVisible: true
+ axisType: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ {
+ name: 'sharedTimeRange'
+ isOptional: true
+ }
+ ]
+ #disable-next-line BCP036
+ type: 'Extension/HubsExtension/PartType/MonitorChartPart'
+ settings: {}
+ }
+ }
+ ]
+ }
+ ]
+ }
+}
+
+resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = {
+ name: applicationInsightsName
+}
diff --git a/cli/azd/infra/core/monitor/applicationinsights.bicep b/cli/azd/infra/core/monitor/applicationinsights.bicep
new file mode 100644
index 00000000000..f76b292b669
--- /dev/null
+++ b/cli/azd/infra/core/monitor/applicationinsights.bicep
@@ -0,0 +1,30 @@
+param name string
+param dashboardName string
+param location string = resourceGroup().location
+param tags object = {}
+
+param logAnalyticsWorkspaceId string
+
+resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
+ name: name
+ location: location
+ tags: tags
+ kind: 'web'
+ properties: {
+ Application_Type: 'web'
+ WorkspaceResourceId: logAnalyticsWorkspaceId
+ }
+}
+
+module applicationInsightsDashboard 'applicationinsights-dashboard.bicep' = {
+ name: 'application-insights-dashboard'
+ params: {
+ name: dashboardName
+ location: location
+ applicationInsightsName: applicationInsights.name
+ }
+}
+
+output connectionString string = applicationInsights.properties.ConnectionString
+output instrumentationKey string = applicationInsights.properties.InstrumentationKey
+output name string = applicationInsights.name
diff --git a/cli/azd/infra/core/monitor/loganalytics.bicep b/cli/azd/infra/core/monitor/loganalytics.bicep
new file mode 100644
index 00000000000..770544ccab4
--- /dev/null
+++ b/cli/azd/infra/core/monitor/loganalytics.bicep
@@ -0,0 +1,21 @@
+param name string
+param location string = resourceGroup().location
+param tags object = {}
+
+resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = {
+ name: name
+ location: location
+ tags: tags
+ properties: any({
+ retentionInDays: 30
+ features: {
+ searchVersion: 1
+ }
+ sku: {
+ name: 'PerGB2018'
+ }
+ })
+}
+
+output id string = logAnalytics.id
+output name string = logAnalytics.name
diff --git a/cli/azd/infra/core/monitor/monitoring.bicep b/cli/azd/infra/core/monitor/monitoring.bicep
new file mode 100644
index 00000000000..96ba11e5e0b
--- /dev/null
+++ b/cli/azd/infra/core/monitor/monitoring.bicep
@@ -0,0 +1,31 @@
+param logAnalyticsName string
+param applicationInsightsName string
+param applicationInsightsDashboardName string
+param location string = resourceGroup().location
+param tags object = {}
+
+module logAnalytics 'loganalytics.bicep' = {
+ name: 'loganalytics'
+ params: {
+ name: logAnalyticsName
+ location: location
+ tags: tags
+ }
+}
+
+module applicationInsights 'applicationinsights.bicep' = {
+ name: 'applicationinsights'
+ params: {
+ name: applicationInsightsName
+ location: location
+ tags: tags
+ dashboardName: applicationInsightsDashboardName
+ logAnalyticsWorkspaceId: logAnalytics.outputs.id
+ }
+}
+
+output applicationInsightsConnectionString string = applicationInsights.outputs.connectionString
+output applicationInsightsInstrumentationKey string = applicationInsights.outputs.instrumentationKey
+output applicationInsightsName string = applicationInsights.outputs.name
+output logAnalyticsWorkspaceId string = logAnalytics.outputs.id
+output logAnalyticsWorkspaceName string = logAnalytics.outputs.name
diff --git a/cli/azd/infra/core/openai/openai.bicep b/cli/azd/infra/core/openai/openai.bicep
new file mode 100644
index 00000000000..d2c429c2bd2
--- /dev/null
+++ b/cli/azd/infra/core/openai/openai.bicep
@@ -0,0 +1,63 @@
+metadata description = 'Creates an Azure Cognitive Services instance.'
+param name string
+param location string = resourceGroup().location
+param tags object = {}
+@description('The custom subdomain name used to access the API. Defaults to the value of the name parameter.')
+param customSubDomainName string = name
+param deployments array = []
+param kind string = 'OpenAI'
+param userAssignedIdentityID string
+
+@allowed([ 'Enabled', 'Disabled' ])
+param publicNetworkAccess string = 'Enabled'
+param sku object = {
+ name: 'S0'
+}
+
+param allowedIpRules array = []
+param networkAcls object = empty(allowedIpRules) ? {
+ defaultAction: 'Allow'
+} : {
+ ipRules: allowedIpRules
+ defaultAction: 'Deny'
+}
+param disableLocalAuth bool = false
+
+resource account 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
+ name: name
+ location: location
+ tags: tags
+ kind: kind
+ identity: {
+ type: 'UserAssigned'
+ userAssignedIdentities: {
+ '${userAssignedIdentityID}': {}
+ }
+ }
+ properties: {
+ customSubDomainName: customSubDomainName
+ publicNetworkAccess: publicNetworkAccess
+ networkAcls: networkAcls
+ disableLocalAuth: disableLocalAuth
+ }
+ sku: sku
+}
+
+@batchSize(1)
+resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [for deployment in deployments: {
+ parent: account
+ name: deployment.name
+ properties: {
+ model: deployment.model
+ raiPolicyName: contains(deployment, 'raiPolicyName') ? deployment.raiPolicyName : null
+ }
+ sku: contains(deployment, 'sku') ? deployment.sku : {
+ name: 'Standard'
+ capacity: 20
+ }
+}]
+
+output openaiendpoint string = account.properties.endpoint
+output id string = account.id
+output name string = account.name
+
diff --git a/cli/azd/infra/core/security/keyvault-access.bicep b/cli/azd/infra/core/security/keyvault-access.bicep
new file mode 100644
index 00000000000..96c9cf73034
--- /dev/null
+++ b/cli/azd/infra/core/security/keyvault-access.bicep
@@ -0,0 +1,21 @@
+param name string = 'add'
+
+param keyVaultName string = ''
+param permissions object = { secrets: [ 'get', 'list' ] }
+param principalId string
+
+resource keyVaultAccessPolicies 'Microsoft.KeyVault/vaults/accessPolicies@2022-07-01' = {
+ parent: keyVault
+ name: name
+ properties: {
+ accessPolicies: [ {
+ objectId: principalId
+ tenantId: subscription().tenantId
+ permissions: permissions
+ } ]
+ }
+}
+
+resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = {
+ name: keyVaultName
+}
diff --git a/cli/azd/infra/core/security/keyvault.bicep b/cli/azd/infra/core/security/keyvault.bicep
new file mode 100644
index 00000000000..0eb4a86dbc0
--- /dev/null
+++ b/cli/azd/infra/core/security/keyvault.bicep
@@ -0,0 +1,25 @@
+param name string
+param location string = resourceGroup().location
+param tags object = {}
+
+param principalId string = ''
+
+resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = {
+ name: name
+ location: location
+ tags: tags
+ properties: {
+ tenantId: subscription().tenantId
+ sku: { family: 'A', name: 'standard' }
+ accessPolicies: !empty(principalId) ? [
+ {
+ objectId: principalId
+ permissions: { secrets: [ 'get', 'list' ] }
+ tenantId: subscription().tenantId
+ }
+ ] : []
+ }
+}
+
+output endpoint string = keyVault.properties.vaultUri
+output name string = keyVault.name
diff --git a/cli/azd/infra/core/security/managedidentity.bicep b/cli/azd/infra/core/security/managedidentity.bicep
new file mode 100644
index 00000000000..249eb579de1
--- /dev/null
+++ b/cli/azd/infra/core/security/managedidentity.bicep
@@ -0,0 +1,15 @@
+param location string = resourceGroup().location
+param tags object = {}
+param identityName string
+
+// Create the user-assigned managed identity
+resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
+ name: identityName
+ tags: tags
+ location: location
+}
+
+output userAssignedIdentity object = managedIdentity
+output clientId string = managedIdentity.properties.clientId
+output userAssignedIdentityID string = managedIdentity.id
+output principalId string = managedIdentity.properties.principalId
diff --git a/cli/azd/infra/core/security/role.bicep b/cli/azd/infra/core/security/role.bicep
new file mode 100644
index 00000000000..0b30cfd3445
--- /dev/null
+++ b/cli/azd/infra/core/security/role.bicep
@@ -0,0 +1,21 @@
+metadata description = 'Creates a role assignment for a service principal.'
+param principalId string
+
+@allowed([
+ 'Device'
+ 'ForeignGroup'
+ 'Group'
+ 'ServicePrincipal'
+ 'User'
+])
+param principalType string = 'ServicePrincipal'
+param roleDefinitionId string
+
+resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
+ name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId)
+ properties: {
+ principalId: principalId
+ principalType: principalType
+ roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId)
+ }
+}
diff --git a/cli/azd/infra/core/security/roleassignments.bicep b/cli/azd/infra/core/security/roleassignments.bicep
new file mode 100644
index 00000000000..d0cd10fe694
--- /dev/null
+++ b/cli/azd/infra/core/security/roleassignments.bicep
@@ -0,0 +1,22 @@
+param managedIdentityPrincipalID string
+param managedIdentityID string
+
+// Assign the Contributor role to the managed identity at the resource group level
+resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
+ name: guid(managedIdentityID, 'Contributor')
+ properties: {
+ roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c') // Contributor role ID
+ principalType: 'ServicePrincipal'
+ principalId: managedIdentityPrincipalID
+ }
+}
+
+// Assign the Contributor role to the managed identity at the resource group level
+resource roleAssignment2 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
+ name: guid(managedIdentityID, 'CognitiveServicesUser')
+ properties: {
+ roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd') // Cognitive Services User role ID
+ principalType: 'ServicePrincipal'
+ principalId: managedIdentityPrincipalID
+ }
+}
diff --git a/cli/azd/infra/main.bicep b/cli/azd/infra/main.bicep
new file mode 100644
index 00000000000..c1bd1c89646
--- /dev/null
+++ b/cli/azd/infra/main.bicep
@@ -0,0 +1,229 @@
+targetScope = 'subscription'
+
+@minLength(1)
+@maxLength(64)
+@description('Name of the the environment which is used to generate a short unique hash used in all resources.')
+param environmentName string
+
+@minLength(1)
+@description('Primary location for all resources')
+param location string
+
+param appName string = ''
+param openAIName string = ''
+param applicationInsightsDashboardName string = ''
+param applicationInsightsName string = ''
+param appServicePlanName string = ''
+@secure()
+param keyVaultName string = ''
+param logAnalyticsName string = ''
+param resourceGroupName string = ''
+param managedIdentityName string = ''
+
+@description('Id of the user or app to assign application roles')
+param principalId string = ''
+/*param managedIdentityName string = ''
+
+// Create a User-Assigned Managed Identity
+resource userAssignedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2021-09-30' = {
+ name: managedIdentityName
+ location: location
+}
+*/
+
+var abbrs = loadJsonContent('./abbreviations.json')
+var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))
+var tags = { 'azd-env-name': environmentName }
+
+// Organize resources in a resource group
+resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = {
+ name: !empty(resourceGroupName) ? resourceGroupName : '${abbrs.resourcesResourceGroups}${environmentName}'
+ location: location
+ tags: tags
+}
+
+// Create an App Service Plan to group applications under the same payment plan and SKU
+module appServicePlan './core/host/appserviceplan.bicep' = {
+ name: 'appserviceplan'
+ scope: rg
+ params: {
+ name: !empty(appServicePlanName) ? appServicePlanName : '${abbrs.webServerFarms}${resourceToken}'
+ location: location
+ tags: tags
+ sku: {
+ name: 'P0v3'
+ }
+ }
+}
+
+// Monitor application with Azure Monitor
+module monitoring './core/monitor/monitoring.bicep' = {
+ name: 'monitoring'
+ scope: rg
+ params: {
+ location: location
+ tags: tags
+ logAnalyticsName: !empty(logAnalyticsName) ? logAnalyticsName : '${abbrs.operationalInsightsWorkspaces}${resourceToken}'
+ applicationInsightsName: !empty(applicationInsightsName) ? applicationInsightsName : '${abbrs.insightsComponents}${resourceToken}'
+ applicationInsightsDashboardName: !empty(applicationInsightsDashboardName) ? applicationInsightsDashboardName : '${abbrs.portalDashboards}${resourceToken}'
+ }
+}
+
+// Store secrets in a keyvault
+module keyVault './core/security/keyvault.bicep' = {
+ name: 'keyvault'
+ scope: rg
+ params: {
+ name: !empty(keyVaultName) ? keyVaultName : '${abbrs.keyVaultVaults}${resourceToken}'
+ location: location
+ tags: tags
+ principalId: principalId
+ }
+}
+
+// Store secrets in a keyvault
+module managedidentity './core/security/managedidentity.bicep' = {
+ name: 'managedidentity'
+ scope: rg
+ params: {
+ identityName: !empty(managedIdentityName) ? managedIdentityName : '${abbrs.keyVaultVaults}${resourceToken}-mi'
+ location: location
+ tags: tags
+ }
+}
+
+// The application database
+/*module mySql './core/database/mysql/mysql-db.bicep' = {
+ name: 'mysql-db'
+ scope: rg
+ params: {
+ location: location
+ tags: tags
+ serverName: !empty(mySqlServerName) ? mySqlServerName : '${abbrs.dBforMySQLServers}${resourceToken}'
+ serverAdminName: mySqlServerAdminName
+ serverAdminPassword: mySqlServerAdminPassword
+ databaseName: !empty(mySqlDatabaseName) ? mySqlDatabaseName : 'petclinic'
+ keyVaultName: keyVault.outputs.name
+ }
+}*/
+
+// The application backend
+module app './app/app.bicep' = {
+ name: 'app'
+ scope: rg
+ params: {
+ name: !empty(appName) ? appName : '${abbrs.webSitesAppService}petclinic-${resourceToken}'
+ location: location
+ tags: tags
+ managedIdentityID: managedidentity.outputs.userAssignedIdentityID
+ managedIdentityName: !empty(appName) ? appName : '${abbrs.webSitesAppService}petclinic-${resourceToken}-mi'
+ applicationInsightsName: monitoring.outputs.applicationInsightsName
+ appServicePlanId: appServicePlan.outputs.id
+ keyVaultName: keyVault.outputs.name
+ appSettings: {
+ APPLICATIONINSIGHTS_CONNECTION_STRING: monitoring.outputs.applicationInsightsConnectionString
+ AZURE_KEY_VAULT_ENDPOINT: keyVault.outputs.endpoint
+ SPRING_PROFILES_ACTIVE: 'azure,h2'
+ OPENAI_DEPLOYMENT_NAME: openAi1.outputs.openaiendpoint
+ AZURE_CLIENT_ID: managedidentity.outputs.clientId
+ //MYSQL_URL: mySql.outputs.endpoint
+ //MYSQL_USER: mySqlServerAdminName
+ }
+ }
+}
+
+module roleAssignments './core/security/roleassignments.bicep' = {
+ scope: rg
+ name: 'role-assignments-mi'
+ params: {
+ managedIdentityID: managedidentity.outputs.userAssignedIdentityID
+ managedIdentityPrincipalID: managedidentity.outputs.principalId
+ }
+}
+
+// Give the API access to KeyVault
+/*module appKeyVaultAccess './core/security/keyvault-access.bicep' = {
+ name: 'app-keyvault-access'
+ scope: rg
+ params: {
+ keyVaultName: keyVault.outputs.name
+ principalId: app.outputs.APP_IDENTITY_PRINCIPAL_ID
+ }
+}*/
+
+
+@description('Location for the OpenAI resource group')
+@allowed(['australiaeast', 'canadaeast', 'eastus', 'eastus2', 'francecentral', 'japaneast', 'northcentralus', 'swedencentral', 'switzerlandnorth', 'uksouth', 'westeurope'])
+@metadata({
+ azd: {
+ type: 'location'
+ }
+})
+param openAiLocation string // Set in main.parameters.json
+
+// FIRST: creating Azure Cognitive Services account for OpenAI
+module openAi1 'core/openai/openai.bicep' = {
+ name: 'openai1'
+ scope: rg
+ params: {
+ name: !empty(openAIName) ? openAIName : '${abbrs.webSitesAppService}petclinic-${resourceToken}-oai'
+ location: openAiLocation
+ tags: tags
+ sku: {
+ name: 'S0'
+ }
+ userAssignedIdentityID: managedidentity.outputs.userAssignedIdentityID
+ disableLocalAuth: true
+ deployments: [
+ {
+ name: 'gpt-4o-model'
+ raiPolicyName: 'Microsoft.Default'
+ model: {
+ format: 'OpenAI'
+ name: 'gpt-4o'
+ }
+ sku: {
+ name: 'Standard'
+ capacity: 2
+ }
+ }
+ ]
+ }
+}
+
+
+// Roles
+
+// Assign the role (to Cog service account 1), a role entry is added to Cognitive Services account with the following args:
+// - roleDefinitionId (Cognitive Service User),
+// - principalId (app service instance)
+// - scope (Cognitive Services account)
+/*module openAi1RoleAppService 'core/security/role.bicep' = {
+ scope: rg
+ name: 'openai1-role-appservice'
+ params: {
+ principalId: managedidentity.outputs.principalId
+ // Cognitive Services OpenAI User
+ roleDefinitionId: '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd'
+ principalType: 'ServicePrincipal'
+ }
+}*/
+
+
+
+output AZURE_RESOURCE_GROUP string = rg.name
+output DEPLOYMENT_ID string = 'gpt-4o-model'
+output OPENAI_DEPLOYMENT_NAME string = openAi1.outputs.openaiendpoint
+// Data outputs
+//output MYSQL_URL string = mySql.outputs.endpoint
+//output MYSQL_USER string = mySqlServerAdminName
+output WEBSITES_PORT int = 8080
+
+// App outputs
+output APPLICATIONINSIGHTS_CONNECTION_STRING string = monitoring.outputs.applicationInsightsConnectionString
+output AZURE_KEY_VAULT_ENDPOINT string = keyVault.outputs.endpoint
+output AZURE_KEY_VAULT_NAME string = keyVault.outputs.name
+output AZURE_LOCATION string = location
+output AZURE_TENANT_ID string = tenant().tenantId
+output SPRING_PROFILES_ACTIVE string = 'azure,h2'
+output AZURE_CLIENT_ID string = managedidentity.outputs.clientId
diff --git a/cli/azd/infra/main.parameters.json b/cli/azd/infra/main.parameters.json
new file mode 100644
index 00000000000..db6e8a847d8
--- /dev/null
+++ b/cli/azd/infra/main.parameters.json
@@ -0,0 +1,24 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
+ "contentVersion": "1.0.0.0",
+ "parameters": {
+ "environmentName": {
+ "value": "${AZURE_ENV_NAME}"
+ },
+ "location": {
+ "value": "${AZURE_LOCATION}"
+ },
+ "principalId": {
+ "value": "${AZURE_PRINCIPAL_ID}"
+ },
+ "openAiLocation": {
+ "value": "${AZURE_OPENAI_LOCATION=eastus2}"
+ },
+ "openAiApiVersion": {
+ "value": "${AZURE_OPENAI_API_VERSION=2024-02-01}"
+ },
+ "mySqlServerAdminPassword": {
+ "value": "$(secretOrRandomPassword ${AZURE_KEY_VAULT_NAME} MYSQL-PASS)"
+ }
+ }
+}
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/application-0.0.1-SNAPSHOT.jar b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/application-0.0.1-SNAPSHOT.jar
new file mode 100644
index 00000000000..737ce3a1d1b
Binary files /dev/null and b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/application-0.0.1-SNAPSHOT.jar differ
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/application-0.0.1-SNAPSHOT.jar.original b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/application-0.0.1-SNAPSHOT.jar.original
new file mode 100644
index 00000000000..eb22830a614
Binary files /dev/null and b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/application-0.0.1-SNAPSHOT.jar.original differ
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/classes/application.properties b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/classes/application.properties
new file mode 100644
index 00000000000..7c40093f75e
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/classes/application.properties
@@ -0,0 +1 @@
+service.message=Hello, World
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/classes/com/example/multimodule/application/DemoApplication.class b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/classes/com/example/multimodule/application/DemoApplication.class
new file mode 100644
index 00000000000..e1ccfdc67ad
Binary files /dev/null and b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/classes/com/example/multimodule/application/DemoApplication.class differ
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-archiver/pom.properties b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-archiver/pom.properties
new file mode 100644
index 00000000000..dee8deb6cf5
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-archiver/pom.properties
@@ -0,0 +1,3 @@
+artifactId=application
+groupId=com.example
+version=0.0.1-SNAPSHOT
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
new file mode 100644
index 00000000000..c739242a679
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -0,0 +1 @@
+com/example/multimodule/application/DemoApplication.class
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
new file mode 100644
index 00000000000..8f45d434fe8
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -0,0 +1 @@
+/Users/rj96cx/Cute/azure-dev/cli/azd/internal/appdetect/testdata/java-multimodules/application/src/main/java/com/example/multimodule/application/DemoApplication.java
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
new file mode 100644
index 00000000000..c73b7791fd8
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
@@ -0,0 +1 @@
+com/example/multimodule/application/DemoApplicationTest.class
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
new file mode 100644
index 00000000000..2c59f91fb26
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
@@ -0,0 +1 @@
+/Users/rj96cx/Cute/azure-dev/cli/azd/internal/appdetect/testdata/java-multimodules/application/src/test/java/com/example/multimodule/application/DemoApplicationTest.java
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/test-classes/com/example/multimodule/application/DemoApplicationTest.class b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/test-classes/com/example/multimodule/application/DemoApplicationTest.class
new file mode 100644
index 00000000000..44a9777b226
Binary files /dev/null and b/cli/azd/internal/appdetect/testdata/java-multimodules/application/target/test-classes/com/example/multimodule/application/DemoApplicationTest.class differ
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/classes/com/example/multimodule/service/MyService.class b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/classes/com/example/multimodule/service/MyService.class
new file mode 100644
index 00000000000..effc4082e44
Binary files /dev/null and b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/classes/com/example/multimodule/service/MyService.class differ
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/classes/com/example/multimodule/service/ServiceProperties.class b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/classes/com/example/multimodule/service/ServiceProperties.class
new file mode 100644
index 00000000000..acf749c3475
Binary files /dev/null and b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/classes/com/example/multimodule/service/ServiceProperties.class differ
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/library-0.0.1-SNAPSHOT.jar b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/library-0.0.1-SNAPSHOT.jar
new file mode 100644
index 00000000000..f223ceba23e
Binary files /dev/null and b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/library-0.0.1-SNAPSHOT.jar differ
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-archiver/pom.properties b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-archiver/pom.properties
new file mode 100644
index 00000000000..560b2bd24b9
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-archiver/pom.properties
@@ -0,0 +1,3 @@
+artifactId=library
+groupId=com.example
+version=0.0.1-SNAPSHOT
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
new file mode 100644
index 00000000000..16509196862
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -0,0 +1,2 @@
+com/example/multimodule/service/MyService.class
+com/example/multimodule/service/ServiceProperties.class
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
new file mode 100644
index 00000000000..24e972fe7ce
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -0,0 +1,2 @@
+/Users/rj96cx/Cute/azure-dev/cli/azd/internal/appdetect/testdata/java-multimodules/library/src/main/java/com/example/multimodule/service/MyService.java
+/Users/rj96cx/Cute/azure-dev/cli/azd/internal/appdetect/testdata/java-multimodules/library/src/main/java/com/example/multimodule/service/ServiceProperties.java
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
new file mode 100644
index 00000000000..a3b1debe082
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
@@ -0,0 +1,2 @@
+com/example/multimodule/service/MyServiceTest$TestConfiguration.class
+com/example/multimodule/service/MyServiceTest.class
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
new file mode 100644
index 00000000000..6610d77ec41
--- /dev/null
+++ b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
@@ -0,0 +1 @@
+/Users/rj96cx/Cute/azure-dev/cli/azd/internal/appdetect/testdata/java-multimodules/library/src/test/java/com/example/multimodule/service/MyServiceTest.java
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/test-classes/com/example/multimodule/service/MyServiceTest$TestConfiguration.class b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/test-classes/com/example/multimodule/service/MyServiceTest$TestConfiguration.class
new file mode 100644
index 00000000000..31d777947d7
Binary files /dev/null and b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/test-classes/com/example/multimodule/service/MyServiceTest$TestConfiguration.class differ
diff --git a/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/test-classes/com/example/multimodule/service/MyServiceTest.class b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/test-classes/com/example/multimodule/service/MyServiceTest.class
new file mode 100644
index 00000000000..ded2a006ef3
Binary files /dev/null and b/cli/azd/internal/appdetect/testdata/java-multimodules/library/target/test-classes/com/example/multimodule/service/MyServiceTest.class differ
diff --git a/cli/azd/mvnw b/cli/azd/mvnw
new file mode 100644
index 00000000000..2c90d17e42f
--- /dev/null
+++ b/cli/azd/mvnw
@@ -0,0 +1,310 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0'
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+ if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+ fi
+
+ if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+ fi
+
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ MINGW*) mingw=true;;
+ Darwin*) darwin=true
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+ if [ -z "$JAVA_HOME" ]; then
+ if [ -x "/usr/libexec/java_home" ]; then
+ export JAVA_HOME="`/usr/libexec/java_home`"
+ else
+ export JAVA_HOME="/Library/Java/Home"
+ fi
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+ done
+
+ saveddir=`pwd`
+
+ M2_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ M2_HOME=`cd "$M2_HOME" && pwd`
+
+ cd "$saveddir"
+ # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --unix "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME="`(cd "$M2_HOME"; pwd)`"
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+ javaExecutable="`which javac`"
+ if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+ # readlink(1) is not available as standard on Solaris 10.
+ readLink=`which readlink`
+ if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+ if $darwin ; then
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+ else
+ javaExecutable="`readlink -f \"$javaExecutable\"`"
+ fi
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+ JAVA_HOME="$javaHome"
+ export JAVA_HOME
+ fi
+ fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD="`which java`"
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly." >&2
+ echo " We cannot execute $JAVACMD" >&2
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+ if [ -z "$1" ]
+ then
+ echo "Path not specified to find_maven_basedir"
+ return 1
+ fi
+
+ basedir="$1"
+ wdir="$1"
+ while [ "$wdir" != '/' ] ; do
+ if [ -d "$wdir"/.mvn ] ; then
+ basedir=$wdir
+ break
+ fi
+ # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+ if [ -d "${wdir}" ]; then
+ wdir=`cd "$wdir/.."; pwd`
+ fi
+ # end of workaround
+ done
+ echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+ if [ -f "$1" ]; then
+ echo "$(tr -s '\n' ' ' < "$1")"
+ fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+ exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+ fi
+ if [ -n "$MVNW_REPOURL" ]; then
+ jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ else
+ jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ fi
+ while IFS="=" read key value; do
+ case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+ esac
+ done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Downloading from: $jarUrl"
+ fi
+ wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+ if $cygwin; then
+ wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+ fi
+
+ if command -v wget > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found wget ... using wget"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ wget "$jarUrl" -O "$wrapperJarPath"
+ else
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+ fi
+ elif command -v curl > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found curl ... using curl"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ curl -o "$wrapperJarPath" "$jarUrl" -f
+ else
+ curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+ fi
+
+ else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Falling back to using Java to download"
+ fi
+ javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ # For Cygwin, switch paths to Windows format before running javac
+ if $cygwin; then
+ javaClass=`cygpath --path --windows "$javaClass"`
+ fi
+ if [ -e "$javaClass" ]; then
+ if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Compiling MavenWrapperDownloader.java ..."
+ fi
+ # Compiling the Java class
+ ("$JAVA_HOME/bin/javac" "$javaClass")
+ fi
+ if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ # Running the downloader
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Running MavenWrapperDownloader.java ..."
+ fi
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+ fi
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+ echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+ MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+ "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/cli/azd/mvnw.cmd b/cli/azd/mvnw.cmd
new file mode 100644
index 00000000000..0d34af4501b
--- /dev/null
+++ b/cli/azd/mvnw.cmd
@@ -0,0 +1,182 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM https://www.apache.org/licenses/LICENSE-2.0'
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Found %WRAPPER_JAR%
+ )
+) else (
+ if not "%MVNW_REPOURL%" == "" (
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ )
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ )
+
+ powershell -Command "&{"^
+ "$webclient = new-object System.Net.WebClient;"^
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+ "}"^
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+ "}"
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Finished downloading %WRAPPER_JAR%
+ )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%
diff --git a/cli/azd/pom.xml b/cli/azd/pom.xml
new file mode 100644
index 00000000000..7256ae4d2a0
--- /dev/null
+++ b/cli/azd/pom.xml
@@ -0,0 +1,485 @@
+
+
+ 4.0.0
+ org.springframework.samples
+ spring-petclinic
+ 2.7.3
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.7.3
+
+ petclinic
+
+
+
+
+ 1.8
+ UTF-8
+ UTF-8
+
+
+ 5.1.3
+ 4.7.0
+
+ 0.8.7
+ 0.0.10
+ 0.0.31
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ true
+
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+ org.springframework.boot
+ spring-boot-starter-cache
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+ org.springframework.boot
+ spring-boot-starter-thymeleaf
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+ org.springframework.boot
+ spring-boot-starter-websocket
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-amqp
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-reactor-netty
+
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ runtime
+
+
+
+
+ com.h2database
+ h2
+ runtime
+
+
+ mysql
+ mysql-connector-java
+ runtime
+
+
+ org.postgresql
+ postgresql
+ runtime
+
+
+
+
+ javax.cache
+ cache-api
+
+
+ org.ehcache
+ ehcache
+
+
+
+
+ org.webjars.npm
+ bootstrap
+ ${webjars-bootstrap.version}
+
+
+ org.webjars.npm
+ font-awesome
+ ${webjars-font-awesome.version}
+
+
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ true
+
+
+
+
+ com.azure.spring
+ spring-cloud-azure-starter-keyvault-secrets
+ 4.4.1
+
+
+ com.microsoft.azure
+ applicationinsights-runtime-attach
+ 3.4.4
+
+
+ com.azure
+ azure-ai-openai
+ 1.0.0-beta.8
+
+
+ com.azure
+ azure-identity
+ 1.12.2
+
+
+ mysql
+ mysql-connector-java
+ 8.0.30
+
+
+ com.azure
+ azure-identity-extensions
+ 1.1.5
+
+
+ com.azure.spring
+ spring-cloud-azure-starter-keyvault-secrets
+ 4.19.0
+
+
+
+
+
+
+
+
+ kr.motd.maven
+ os-maven-plugin
+ 1.6.2
+
+
+
+
+
+ org.xolstice.maven.plugins
+ protobuf-maven-plugin
+ 0.6.1
+
+ com.google.protobuf:protoc:3.9.0:exe:${os.detected.classifier}
+ grpc-java
+ io.grpc:protoc-gen-grpc-java:1.24.0:exe:${os.detected.classifier}
+
+
+
+
+ compile
+ compile-custom
+
+
+
+
+
+ io.spring.javaformat
+ spring-javaformat-maven-plugin
+ ${spring-format.version}
+
+
+ validate
+
+ validate
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ 3.1.2
+
+
+ com.puppycrawl.tools
+ checkstyle
+ 8.45.1
+
+
+ io.spring.nohttp
+ nohttp-checkstyle
+ ${nohttp-checkstyle.version}
+
+
+
+
+ nohttp-checkstyle-validation
+ validate
+
+ src/checkstyle/nohttp-checkstyle.xml
+ src/checkstyle/nohttp-checkstyle-suppressions.xml
+ UTF-8
+ ${basedir}
+ **/*
+ **/.git/**/*,**/.idea/**/*,**/target/**/,**/.flattened-pom.xml,**/*.class
+
+
+ check
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+ build-info
+
+
+
+ ${project.build.sourceEncoding}
+ ${project.reporting.outputEncoding}
+ ${maven.compiler.source}
+ ${maven.compiler.target}
+
+
+
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ ${jacoco.version}
+
+
+
+ prepare-agent
+
+
+
+ report
+ prepare-package
+
+ report
+
+
+
+
+
+
+
+ pl.project13.maven
+ git-commit-id-plugin
+
+
+
+ revision
+
+
+
+
+ true
+ yyyy-MM-dd'T'HH:mm:ssZ
+ true
+ ${project.build.outputDirectory}/git.properties
+
+ false
+ false
+
+
+
+
+
+
+
+
+ Apache License, Version 2.0
+ https://www.apache.org/licenses/LICENSE-2.0
+
+
+
+
+
+ spring-snapshots
+ Spring Snapshots
+ https://repo.spring.io/snapshot
+
+ true
+
+
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+ false
+
+
+
+
+
+
+ spring-snapshots
+ Spring Snapshots
+ https://repo.spring.io/snapshot
+
+ true
+
+
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+ false
+
+
+
+
+
+
+ css
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ unpack
+
+ generate-resources
+
+ unpack
+
+
+
+
+ org.webjars.npm
+ bootstrap
+ ${webjars-bootstrap.version}
+
+
+ ${project.build.directory}/webjars
+
+
+
+
+
+
+ com.gitlab.haynes
+ libsass-maven-plugin
+ 0.2.26
+
+
+ generate-resources
+
+
+ compile
+
+
+
+
+ ${basedir}/src/main/scss/
+ ${basedir}/src/main/resources/static/resources/css/
+ ${project.build.directory}/webjars/META-INF/resources/webjars/bootstrap/${webjars-bootstrap.version}/scss/
+
+
+
+
+
+
+ m2e
+
+
+ m2e.version
+
+
+
+
+
+
+
+ org.eclipse.m2e
+ lifecycle-mapping
+ 1.0.0
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ [1,)
+
+ check
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ [1,)
+
+ build-info
+
+
+
+
+
+
+
+
+ io.spring.javaformat
+ spring-javaformat-maven-plugin
+ [0,)
+
+ validate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cli/azd/src/checkstyle/nohttp-checkstyle-suppressions.xml b/cli/azd/src/checkstyle/nohttp-checkstyle-suppressions.xml
new file mode 100644
index 00000000000..58da146fac9
--- /dev/null
+++ b/cli/azd/src/checkstyle/nohttp-checkstyle-suppressions.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/cli/azd/src/checkstyle/nohttp-checkstyle.xml b/cli/azd/src/checkstyle/nohttp-checkstyle.xml
new file mode 100644
index 00000000000..e6205127bfc
--- /dev/null
+++ b/cli/azd/src/checkstyle/nohttp-checkstyle.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java
new file mode 100644
index 00000000000..18697cba300
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.samples.petclinic;
+
+import com.microsoft.applicationinsights.attach.ApplicationInsights;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * PetClinic Spring Boot Application.
+ *
+ * @author Dave Syer
+ *
+ */
+@SpringBootApplication
+public class PetClinicApplication {
+
+ public static void main(String[] args) {
+ // enable Application Insights Java programmatically, see
+ // https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-spring-boot#enabling-programmatically
+ ApplicationInsights.attach();
+
+ SpringApplication.run(PetClinicApplication.class, args);
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/chat/ChatController.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/chat/ChatController.java
new file mode 100644
index 00000000000..7ede592f8fe
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/chat/ChatController.java
@@ -0,0 +1,98 @@
+package org.springframework.samples.petclinic.chat;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.springframework.samples.petclinic.model.LocalChatMessage;
+import org.springframework.messaging.handler.annotation.MessageMapping;
+import org.springframework.messaging.handler.annotation.Payload;
+import org.springframework.messaging.handler.annotation.SendTo;
+import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
+import org.springframework.messaging.simp.SimpMessagingTemplate;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.stereotype.Controller;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+
+import com.azure.ai.openai.OpenAIClient;
+import com.azure.ai.openai.OpenAIClientBuilder;
+import com.azure.ai.openai.models.ChatChoice;
+import com.azure.ai.openai.models.ChatCompletions;
+import com.azure.ai.openai.models.ChatCompletionsOptions;
+import com.azure.ai.openai.models.ChatRequestMessage;
+import com.azure.ai.openai.models.ChatRequestAssistantMessage;
+import com.azure.ai.openai.models.ChatRequestSystemMessage;
+import com.azure.ai.openai.models.ChatRequestUserMessage;
+import com.azure.ai.openai.models.ChatResponseMessage;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+import com.azure.core.credential.TokenCredential;
+
+/**
+ * Created by rajeevkumarsingh on 24/07/17.
+ */
+@Controller
+public class ChatController {
+
+ @Autowired
+ private Environment env;
+
+ @MessageMapping("/chat.sendMessageAI")
+ @SendTo("/topic/public")
+ public LocalChatMessage sendMessageAI(@Payload LocalChatMessage localChatMessage) {
+ // sendMessage(localChatMessage);
+
+ System.out.println("Deployment name is: " + env.getProperty("OPENAI_DEPLOYMENT_NAME"));
+
+ TokenCredential defaultCredential = new DefaultAzureCredentialBuilder().build();
+ OpenAIClient client = new OpenAIClientBuilder().credential(defaultCredential)
+ .endpoint(env.getProperty("OPENAI_DEPLOYMENT_NAME")).buildClient();
+
+ List chatMessages = new ArrayList<>();
+
+ String s = localChatMessage.getContent();
+ chatMessages.add(new ChatRequestSystemMessage(
+ "Assistant is an intelligent chatbot designed to help people find information."));
+
+ chatMessages.add(new ChatRequestUserMessage(s));
+
+ String deploymentName = "gpt-4o-model";
+ ChatCompletions chatCompletions = client.getChatCompletions(deploymentName,
+ new ChatCompletionsOptions(chatMessages));
+ String response = "";
+ for (ChatChoice choice : chatCompletions.getChoices()) {
+
+ ChatResponseMessage message = choice.getMessage();
+ System.out.println(message.getContent().toString());
+ response = message.getContent();
+ }
+
+ localChatMessage.setContent(response);
+ localChatMessage.setSender("OpenAI");
+ return localChatMessage;
+ }
+
+ @MessageMapping("/chat.sendMessage")
+ @SendTo("/topic/public")
+ public LocalChatMessage sendMessage(LocalChatMessage localChatMessage) {
+ System.out.println(localChatMessage.getContent());
+ return localChatMessage;
+ }
+
+ @MessageMapping("/chat.addUser")
+ @SendTo("/topic/public")
+ public LocalChatMessage addUser(@Payload LocalChatMessage chatMessage, SimpMessageHeaderAccessor headerAccessor) {
+ // Add username in web socket session
+ headerAccessor.getSessionAttributes().put("username", chatMessage.getSender());
+ return chatMessage;
+ }
+
+ public void sendComputerMessage(SimpMessagingTemplate template, String message) {
+ }
+
+ @GetMapping("/chat")
+ public String processForm() {
+ return "chat/chat";
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/chat/WebSocketConfig.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/chat/WebSocketConfig.java
new file mode 100644
index 00000000000..13bab863eec
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/chat/WebSocketConfig.java
@@ -0,0 +1,32 @@
+package org.springframework.samples.petclinic.chat;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.messaging.simp.config.MessageBrokerRegistry;
+import org.springframework.web.socket.config.annotation.*;
+
+/**
+ * Created by rajeevkumarsingh on 24/07/17.
+ */
+@Configuration
+@EnableWebSocketMessageBroker
+public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
+
+ @Override
+ public void registerStompEndpoints(StompEndpointRegistry registry) {
+ registry.addEndpoint("/ws").withSockJS();
+ }
+
+ @Override
+ public void configureMessageBroker(MessageBrokerRegistry registry) {
+ registry.setApplicationDestinationPrefixes("/app");
+ registry.enableSimpleBroker("/topic"); // Enables a simple in-memory broker
+
+ // Use this for enabling a Full featured broker like RabbitMQ
+
+ /*
+ * registry.enableStompBrokerRelay("/topic") .setRelayHost("localhost")
+ * .setRelayPort(61613) .setClientLogin("guest") .setClientPasscode("guest");
+ */
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/chat/WebSocketEventListener.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/chat/WebSocketEventListener.java
new file mode 100644
index 00000000000..14695f38bac
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/chat/WebSocketEventListener.java
@@ -0,0 +1,46 @@
+package org.springframework.samples.petclinic.chat;
+
+import org.springframework.samples.petclinic.model.ChatMessage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.event.EventListener;
+import org.springframework.messaging.simp.SimpMessageSendingOperations;
+import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
+import org.springframework.stereotype.Component;
+import org.springframework.web.socket.messaging.SessionConnectedEvent;
+import org.springframework.web.socket.messaging.SessionDisconnectEvent;
+
+/**
+ * Created by rajeevkumarsingh on 25/07/17.
+ */
+@Component
+public class WebSocketEventListener {
+
+ private static final Logger logger = LoggerFactory.getLogger(WebSocketEventListener.class);
+
+ @Autowired
+ private SimpMessageSendingOperations messagingTemplate;
+
+ @EventListener
+ public void handleWebSocketConnectListener(SessionConnectedEvent event) {
+ logger.info("Received a new web socket connection");
+ }
+
+ @EventListener
+ public void handleWebSocketDisconnectListener(SessionDisconnectEvent event) {
+ StompHeaderAccessor headerAccessor = StompHeaderAccessor.wrap(event.getMessage());
+
+ String username = (String) headerAccessor.getSessionAttributes().get("username");
+ if (username != null) {
+ logger.info("User Disconnected : " + username);
+
+ ChatMessage chatMessage = new ChatMessage();
+ chatMessage.setType(ChatMessage.MessageType.LEAVE);
+ chatMessage.setSender(username);
+
+ messagingTemplate.convertAndSend("/topic/public", chatMessage);
+ }
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/model/BaseEntity.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/BaseEntity.java
new file mode 100644
index 00000000000..4cb9ffc0c08
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/BaseEntity.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.model;
+
+import java.io.Serializable;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.MappedSuperclass;
+
+/**
+ * Simple JavaBean domain object with an id property. Used as a base class for objects
+ * needing this property.
+ *
+ * @author Ken Krebs
+ * @author Juergen Hoeller
+ */
+@MappedSuperclass
+public class BaseEntity implements Serializable {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer id;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public boolean isNew() {
+ return this.id == null;
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/model/ChatMessage.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/ChatMessage.java
new file mode 100644
index 00000000000..e0d238fdcb2
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/ChatMessage.java
@@ -0,0 +1,44 @@
+package org.springframework.samples.petclinic.model;
+
+/**
+ * Created by rajeevkumarsingh on 24/07/17.
+ */
+public class ChatMessage {
+
+ private MessageType type;
+
+ private String content;
+
+ private String sender;
+
+ public enum MessageType {
+
+ CHAT, JOIN, LEAVE
+
+ }
+
+ public MessageType getType() {
+ return type;
+ }
+
+ public void setType(MessageType type) {
+ this.type = type;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getSender() {
+ return sender;
+ }
+
+ public void setSender(String sender) {
+ this.sender = sender;
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/model/LocalChatMessage.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/LocalChatMessage.java
new file mode 100644
index 00000000000..fbba64990b9
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/LocalChatMessage.java
@@ -0,0 +1,44 @@
+package org.springframework.samples.petclinic.model;
+
+/**
+ * Created by rajeevkumarsingh on 24/07/17.
+ */
+public class LocalChatMessage {
+
+ private MessageType type;
+
+ private String content;
+
+ private String sender;
+
+ public enum MessageType {
+
+ CHAT, JOIN, LEAVE
+
+ }
+
+ public MessageType getType() {
+ return type;
+ }
+
+ public void setType(MessageType type) {
+ this.type = type;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getSender() {
+ return sender;
+ }
+
+ public void setSender(String sender) {
+ this.sender = sender;
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java
new file mode 100644
index 00000000000..088e52e81b6
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.model;
+
+import javax.persistence.Column;
+import javax.persistence.MappedSuperclass;
+
+/**
+ * Simple JavaBean domain object adds a name property to BaseEntity. Used as
+ * a base class for objects needing these properties.
+ *
+ * @author Ken Krebs
+ * @author Juergen Hoeller
+ */
+@MappedSuperclass
+public class NamedEntity extends BaseEntity {
+
+ @Column(name = "name")
+ private String name;
+
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return this.getName();
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/model/Person.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/Person.java
new file mode 100644
index 00000000000..15fabacc3b5
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/Person.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.model;
+
+import javax.persistence.Column;
+import javax.persistence.MappedSuperclass;
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * Simple JavaBean domain object representing an person.
+ *
+ * @author Ken Krebs
+ */
+@MappedSuperclass
+public class Person extends BaseEntity {
+
+ @Column(name = "first_name")
+ @NotEmpty
+ private String firstName;
+
+ @Column(name = "last_name")
+ @NotEmpty
+ private String lastName;
+
+ public String getFirstName() {
+ return this.firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return this.lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/model/package-info.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/package-info.java
new file mode 100644
index 00000000000..37d6295e8a3
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/model/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * The classes in this package represent utilities used by the domain.
+ */
+package org.springframework.samples.petclinic.model;
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/Owner.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/Owner.java
new file mode 100644
index 00000000000..52ff1190f03
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/Owner.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.owner;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotEmpty;
+
+import org.springframework.core.style.ToStringCreator;
+import org.springframework.samples.petclinic.model.Person;
+import org.springframework.util.Assert;
+
+/**
+ * Simple JavaBean domain object representing an owner.
+ *
+ * @author Ken Krebs
+ * @author Juergen Hoeller
+ * @author Sam Brannen
+ * @author Michael Isvy
+ * @author Oliver Drotbohm
+ */
+@Entity
+@Table(name = "owners")
+public class Owner extends Person {
+
+ @Column(name = "address")
+ @NotEmpty
+ private String address;
+
+ @Column(name = "city")
+ @NotEmpty
+ private String city;
+
+ @Column(name = "telephone")
+ @NotEmpty
+ @Digits(fraction = 0, integer = 10)
+ private String telephone;
+
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+ @JoinColumn(name = "owner_id")
+ @OrderBy("name")
+ private List pets = new ArrayList<>();
+
+ public String getAddress() {
+ return this.address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getCity() {
+ return this.city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getTelephone() {
+ return this.telephone;
+ }
+
+ public void setTelephone(String telephone) {
+ this.telephone = telephone;
+ }
+
+ public List getPets() {
+ return this.pets;
+ }
+
+ public void addPet(Pet pet) {
+ if (pet.isNew()) {
+ getPets().add(pet);
+ }
+ }
+
+ /**
+ * Return the Pet with the given name, or null if none found for this Owner.
+ * @param name to test
+ * @return a pet if pet name is already in use
+ */
+ public Pet getPet(String name) {
+ return getPet(name, false);
+ }
+
+ /**
+ * Return the Pet with the given id, or null if none found for this Owner.
+ * @param name to test
+ * @return a pet if pet id is already in use
+ */
+ public Pet getPet(Integer id) {
+ for (Pet pet : getPets()) {
+ if (!pet.isNew()) {
+ Integer compId = pet.getId();
+ if (compId.equals(id)) {
+ return pet;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return the Pet with the given name, or null if none found for this Owner.
+ * @param name to test
+ * @return a pet if pet name is already in use
+ */
+ public Pet getPet(String name, boolean ignoreNew) {
+ name = name.toLowerCase();
+ for (Pet pet : getPets()) {
+ if (!ignoreNew || !pet.isNew()) {
+ String compName = pet.getName();
+ compName = compName == null ? "" : compName.toLowerCase();
+ if (compName.equals(name)) {
+ return pet;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringCreator(this).append("id", this.getId()).append("new", this.isNew())
+ .append("lastName", this.getLastName()).append("firstName", this.getFirstName())
+ .append("address", this.address).append("city", this.city).append("telephone", this.telephone)
+ .toString();
+ }
+
+ /**
+ * Adds the given {@link Visit} to the {@link Pet} with the given identifier.
+ * @param petId the identifier of the {@link Pet}, must not be {@literal null}.
+ * @param visit the visit to add, must not be {@literal null}.
+ */
+ public Owner addVisit(Integer petId, Visit visit) {
+
+ Assert.notNull(petId, "Pet identifier must not be null!");
+ Assert.notNull(visit, "Visit must not be null!");
+
+ Pet pet = getPet(petId);
+
+ Assert.notNull(pet, "Invalid Pet identifier!");
+
+ pet.addVisit(visit);
+
+ return this;
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java
new file mode 100644
index 00000000000..3c963271011
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.owner;
+
+import java.util.List;
+import java.util.Map;
+import javax.validation.Valid;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.InitBinder;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @author Juergen Hoeller
+ * @author Ken Krebs
+ * @author Arjen Poutsma
+ * @author Michael Isvy
+ */
+@Controller
+class OwnerController {
+
+ private static final String VIEWS_OWNER_CREATE_OR_UPDATE_FORM = "owners/createOrUpdateOwnerForm";
+
+ private final OwnerRepository owners;
+
+ public OwnerController(OwnerRepository clinicService) {
+ this.owners = clinicService;
+ }
+
+ @InitBinder
+ public void setAllowedFields(WebDataBinder dataBinder) {
+ dataBinder.setDisallowedFields("id");
+ }
+
+ @ModelAttribute("owner")
+ public Owner findOwner(@PathVariable(name = "ownerId", required = false) Integer ownerId) {
+ return ownerId == null ? new Owner() : this.owners.findById(ownerId);
+ }
+
+ @GetMapping("/owners/new")
+ public String initCreationForm(Map model) {
+ Owner owner = new Owner();
+ model.put("owner", owner);
+ return VIEWS_OWNER_CREATE_OR_UPDATE_FORM;
+ }
+
+ @PostMapping("/owners/new")
+ public String processCreationForm(@Valid Owner owner, BindingResult result) {
+ if (result.hasErrors()) {
+ return VIEWS_OWNER_CREATE_OR_UPDATE_FORM;
+ }
+
+ this.owners.save(owner);
+ return "redirect:/owners/" + owner.getId();
+ }
+
+ @GetMapping("/owners/find")
+ public String initFindForm(Map model) {
+ model.put("owner", new Owner());
+ return "owners/findOwners";
+ }
+
+ @GetMapping("/owners")
+ public String processFindForm(@RequestParam(defaultValue = "1") int page, Owner owner, BindingResult result,
+ Model model) {
+ // allow parameterless GET request for /owners to return all records
+ if (owner.getLastName() == null) {
+ owner.setLastName(""); // empty string signifies broadest possible search
+ }
+
+ // find owners by last name
+ Page ownersResults = findPaginatedForOwnersLastName(page, owner.getLastName());
+ if (ownersResults.isEmpty()) {
+ // no owners found
+ result.rejectValue("lastName", "notFound", "not found");
+ return "owners/findOwners";
+ }
+
+ if (ownersResults.getTotalElements() == 1) {
+ // 1 owner found
+ owner = ownersResults.iterator().next();
+ return "redirect:/owners/" + owner.getId();
+ }
+
+ // multiple owners found
+ return addPaginationModel(page, model, ownersResults);
+ }
+
+ private String addPaginationModel(int page, Model model, Page paginated) {
+ model.addAttribute("listOwners", paginated);
+ List listOwners = paginated.getContent();
+ model.addAttribute("currentPage", page);
+ model.addAttribute("totalPages", paginated.getTotalPages());
+ model.addAttribute("totalItems", paginated.getTotalElements());
+ model.addAttribute("listOwners", listOwners);
+ return "owners/ownersList";
+ }
+
+ private Page findPaginatedForOwnersLastName(int page, String lastname) {
+ int pageSize = 5;
+ Pageable pageable = PageRequest.of(page - 1, pageSize);
+ return owners.findByLastName(lastname, pageable);
+ }
+
+ @GetMapping("/owners/{ownerId}/edit")
+ public String initUpdateOwnerForm(@PathVariable("ownerId") int ownerId, Model model) {
+ Owner owner = this.owners.findById(ownerId);
+ model.addAttribute(owner);
+ return VIEWS_OWNER_CREATE_OR_UPDATE_FORM;
+ }
+
+ @PostMapping("/owners/{ownerId}/edit")
+ public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result,
+ @PathVariable("ownerId") int ownerId) {
+ if (result.hasErrors()) {
+ return VIEWS_OWNER_CREATE_OR_UPDATE_FORM;
+ }
+
+ owner.setId(ownerId);
+ this.owners.save(owner);
+ return "redirect:/owners/{ownerId}";
+ }
+
+ /**
+ * Custom handler for displaying an owner.
+ * @param ownerId the ID of the owner to display
+ * @return a ModelMap with the model attributes for the view
+ */
+ @GetMapping("/owners/{ownerId}")
+ public ModelAndView showOwner(@PathVariable("ownerId") int ownerId) {
+ ModelAndView mav = new ModelAndView("owners/ownerDetails");
+ Owner owner = this.owners.findById(ownerId);
+ mav.addObject(owner);
+ return mav;
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/OwnerRepository.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/OwnerRepository.java
new file mode 100644
index 00000000000..062df4576fd
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/OwnerRepository.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.owner;
+
+import java.util.List;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.Repository;
+import org.springframework.data.repository.query.Param;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Repository class for Owner domain objects All method names are compliant
+ * with Spring Data naming conventions so this interface can easily be extended for Spring
+ * Data. See:
+ * https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-creation
+ *
+ * @author Ken Krebs
+ * @author Juergen Hoeller
+ * @author Sam Brannen
+ * @author Michael Isvy
+ */
+public interface OwnerRepository extends Repository {
+
+ /**
+ * Retrieve all {@link PetType}s from the data store.
+ * @return a Collection of {@link PetType}s.
+ */
+ @Query("SELECT ptype FROM PetType ptype ORDER BY ptype.name")
+ @Transactional(readOnly = true)
+ List findPetTypes();
+
+ /**
+ * Retrieve {@link Owner}s from the data store by last name, returning all owners
+ * whose last name starts with the given name.
+ * @param lastName Value to search for
+ * @return a Collection of matching {@link Owner}s (or an empty Collection if none
+ * found)
+ */
+
+ @Query("SELECT DISTINCT owner FROM Owner owner left join owner.pets WHERE owner.lastName LIKE :lastName% ")
+ @Transactional(readOnly = true)
+ Page findByLastName(@Param("lastName") String lastName, Pageable pageable);
+
+ /**
+ * Retrieve an {@link Owner} from the data store by id.
+ * @param id the id to search for
+ * @return the {@link Owner} if found
+ */
+ @Query("SELECT owner FROM Owner owner left join fetch owner.pets WHERE owner.id =:id")
+ @Transactional(readOnly = true)
+ Owner findById(@Param("id") Integer id);
+
+ /**
+ * Save an {@link Owner} to the data store, either inserting or updating it.
+ * @param owner the {@link Owner} to save
+ */
+ void save(Owner owner);
+
+ /**
+ * Returnes all the owners from data store
+ **/
+ @Query("SELECT owner FROM Owner owner")
+ @Transactional(readOnly = true)
+ Page findAll(Pageable pageable);
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/Pet.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/Pet.java
new file mode 100644
index 00000000000..a863c754f19
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/Pet.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.owner;
+
+import java.time.LocalDate;
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.samples.petclinic.model.NamedEntity;
+
+/**
+ * Simple business object representing a pet.
+ *
+ * @author Ken Krebs
+ * @author Juergen Hoeller
+ * @author Sam Brannen
+ */
+@Entity
+@Table(name = "pets")
+public class Pet extends NamedEntity {
+
+ @Column(name = "birth_date")
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ private LocalDate birthDate;
+
+ @ManyToOne
+ @JoinColumn(name = "type_id")
+ private PetType type;
+
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+ @JoinColumn(name = "pet_id")
+ @OrderBy("visit_date ASC")
+ private Set visits = new LinkedHashSet<>();
+
+ public void setBirthDate(LocalDate birthDate) {
+ this.birthDate = birthDate;
+ }
+
+ public LocalDate getBirthDate() {
+ return this.birthDate;
+ }
+
+ public PetType getType() {
+ return this.type;
+ }
+
+ public void setType(PetType type) {
+ this.type = type;
+ }
+
+ public Collection getVisits() {
+ return this.visits;
+ }
+
+ public void addVisit(Visit visit) {
+ getVisits().add(visit);
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetController.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetController.java
new file mode 100644
index 00000000000..2feae7ee2c2
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetController.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.owner;
+
+import java.util.Collection;
+import javax.validation.Valid;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.StringUtils;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.InitBinder;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * @author Juergen Hoeller
+ * @author Ken Krebs
+ * @author Arjen Poutsma
+ */
+@Controller
+@RequestMapping("/owners/{ownerId}")
+class PetController {
+
+ private static final String VIEWS_PETS_CREATE_OR_UPDATE_FORM = "pets/createOrUpdatePetForm";
+
+ private final OwnerRepository owners;
+
+ public PetController(OwnerRepository owners) {
+ this.owners = owners;
+ }
+
+ @ModelAttribute("types")
+ public Collection populatePetTypes() {
+ return this.owners.findPetTypes();
+ }
+
+ @ModelAttribute("owner")
+ public Owner findOwner(@PathVariable("ownerId") int ownerId) {
+ return this.owners.findById(ownerId);
+ }
+
+ @ModelAttribute("pet")
+ public Pet findPet(@PathVariable("ownerId") int ownerId,
+ @PathVariable(name = "petId", required = false) Integer petId) {
+ return petId == null ? new Pet() : this.owners.findById(ownerId).getPet(petId);
+ }
+
+ @InitBinder("owner")
+ public void initOwnerBinder(WebDataBinder dataBinder) {
+ dataBinder.setDisallowedFields("id");
+ }
+
+ @InitBinder("pet")
+ public void initPetBinder(WebDataBinder dataBinder) {
+ dataBinder.setValidator(new PetValidator());
+ }
+
+ @GetMapping("/pets/new")
+ public String initCreationForm(Owner owner, ModelMap model) {
+ Pet pet = new Pet();
+ owner.addPet(pet);
+ model.put("pet", pet);
+ return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
+ }
+
+ @PostMapping("/pets/new")
+ public String processCreationForm(Owner owner, @Valid Pet pet, BindingResult result, ModelMap model) {
+ if (StringUtils.hasLength(pet.getName()) && pet.isNew() && owner.getPet(pet.getName(), true) != null) {
+ result.rejectValue("name", "duplicate", "already exists");
+ }
+
+ owner.addPet(pet);
+ if (result.hasErrors()) {
+ model.put("pet", pet);
+ return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
+ }
+
+ this.owners.save(owner);
+ return "redirect:/owners/{ownerId}";
+ }
+
+ @GetMapping("/pets/{petId}/edit")
+ public String initUpdateForm(Owner owner, @PathVariable("petId") int petId, ModelMap model) {
+ Pet pet = owner.getPet(petId);
+ model.put("pet", pet);
+ return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
+ }
+
+ @PostMapping("/pets/{petId}/edit")
+ public String processUpdateForm(@Valid Pet pet, BindingResult result, Owner owner, ModelMap model) {
+ if (result.hasErrors()) {
+ model.put("pet", pet);
+ return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
+ }
+
+ owner.addPet(pet);
+ this.owners.save(owner);
+ return "redirect:/owners/{ownerId}";
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetType.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetType.java
new file mode 100644
index 00000000000..6f0aa58d377
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetType.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.owner;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+import org.springframework.samples.petclinic.model.NamedEntity;
+
+/**
+ * @author Juergen Hoeller Can be Cat, Dog, Hamster...
+ */
+@Entity
+@Table(name = "types")
+public class PetType extends NamedEntity {
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetTypeFormatter.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetTypeFormatter.java
new file mode 100644
index 00000000000..4fa18da9149
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetTypeFormatter.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.owner;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.Formatter;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.util.Collection;
+import java.util.Locale;
+
+/**
+ * Instructs Spring MVC on how to parse and print elements of type 'PetType'. Starting
+ * from Spring 3.0, Formatters have come as an improvement in comparison to legacy
+ * PropertyEditors. See the following links for more details: - The Spring ref doc:
+ * https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html#format
+ *
+ * @author Mark Fisher
+ * @author Juergen Hoeller
+ * @author Michael Isvy
+ */
+@Component
+public class PetTypeFormatter implements Formatter {
+
+ private final OwnerRepository owners;
+
+ @Autowired
+ public PetTypeFormatter(OwnerRepository owners) {
+ this.owners = owners;
+ }
+
+ @Override
+ public String print(PetType petType, Locale locale) {
+ return petType.getName();
+ }
+
+ @Override
+ public PetType parse(String text, Locale locale) throws ParseException {
+ Collection findPetTypes = this.owners.findPetTypes();
+ for (PetType type : findPetTypes) {
+ if (type.getName().equals(text)) {
+ return type;
+ }
+ }
+ throw new ParseException("type not found: " + text, 0);
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetValidator.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetValidator.java
new file mode 100644
index 00000000000..e1370b42803
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/PetValidator.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.owner;
+
+import org.springframework.util.StringUtils;
+import org.springframework.validation.Errors;
+import org.springframework.validation.Validator;
+
+/**
+ * Validator for Pet forms.
+ *
+ * We're not using Bean Validation annotations here because it is easier to define such
+ * validation rule in Java.
+ *
+ *
+ * @author Ken Krebs
+ * @author Juergen Hoeller
+ */
+public class PetValidator implements Validator {
+
+ private static final String REQUIRED = "required";
+
+ @Override
+ public void validate(Object obj, Errors errors) {
+ Pet pet = (Pet) obj;
+ String name = pet.getName();
+ // name validation
+ if (!StringUtils.hasLength(name)) {
+ errors.rejectValue("name", REQUIRED, REQUIRED);
+ }
+
+ // type validation
+ if (pet.isNew() && pet.getType() == null) {
+ errors.rejectValue("type", REQUIRED, REQUIRED);
+ }
+
+ // birth date validation
+ if (pet.getBirthDate() == null) {
+ errors.rejectValue("birthDate", REQUIRED, REQUIRED);
+ }
+ }
+
+ /**
+ * This Validator validates *just* Pet instances
+ */
+ @Override
+ public boolean supports(Class> clazz) {
+ return Pet.class.isAssignableFrom(clazz);
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/Visit.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/Visit.java
new file mode 100644
index 00000000000..8d911653317
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/Visit.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.owner;
+
+import java.time.LocalDate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import javax.validation.constraints.NotEmpty;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.samples.petclinic.model.BaseEntity;
+
+/**
+ * Simple JavaBean domain object representing a visit.
+ *
+ * @author Ken Krebs
+ * @author Dave Syer
+ */
+@Entity
+@Table(name = "visits")
+public class Visit extends BaseEntity {
+
+ @Column(name = "visit_date")
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ private LocalDate date;
+
+ @NotEmpty
+ private String description;
+
+ /**
+ * Creates a new instance of Visit for the current date
+ */
+ public Visit() {
+ this.date = LocalDate.now();
+ }
+
+ public LocalDate getDate() {
+ return this.date;
+ }
+
+ public void setDate(LocalDate date) {
+ this.date = date;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java
new file mode 100644
index 00000000000..610a3c5b4c2
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.samples.petclinic.owner;
+
+import java.util.Map;
+
+import javax.validation.Valid;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.InitBinder;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+
+/**
+ * @author Juergen Hoeller
+ * @author Ken Krebs
+ * @author Arjen Poutsma
+ * @author Michael Isvy
+ * @author Dave Syer
+ */
+@Controller
+class VisitController {
+
+ private final OwnerRepository owners;
+
+ public VisitController(OwnerRepository owners) {
+ this.owners = owners;
+ }
+
+ @InitBinder
+ public void setAllowedFields(WebDataBinder dataBinder) {
+ dataBinder.setDisallowedFields("id");
+ }
+
+ /**
+ * Called before each and every @RequestMapping annotated method. 2 goals: - Make sure
+ * we always have fresh data - Since we do not use the session scope, make sure that
+ * Pet object always has an id (Even though id is not part of the form fields)
+ * @param petId
+ * @return Pet
+ */
+ @ModelAttribute("visit")
+ public Visit loadPetWithVisit(@PathVariable("ownerId") int ownerId, @PathVariable("petId") int petId,
+ Map model) {
+ Owner owner = this.owners.findById(ownerId);
+
+ Pet pet = owner.getPet(petId);
+ model.put("pet", pet);
+ model.put("owner", owner);
+
+ Visit visit = new Visit();
+ pet.addVisit(visit);
+ return visit;
+ }
+
+ // Spring MVC calls method loadPetWithVisit(...) before initNewVisitForm is
+ // called
+ @GetMapping("/owners/{ownerId}/pets/{petId}/visits/new")
+ public String initNewVisitForm() {
+ return "pets/createOrUpdateVisitForm";
+ }
+
+ // Spring MVC calls method loadPetWithVisit(...) before processNewVisitForm is
+ // called
+ @PostMapping("/owners/{ownerId}/pets/{petId}/visits/new")
+ public String processNewVisitForm(@ModelAttribute Owner owner, @PathVariable int petId, @Valid Visit visit,
+ BindingResult result) {
+ if (result.hasErrors()) {
+ return "pets/createOrUpdateVisitForm";
+ }
+
+ owner.addVisit(petId, visit);
+ this.owners.save(owner);
+ return "redirect:/owners/{ownerId}";
+ }
+
+}
diff --git a/cli/azd/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java b/cli/azd/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java
new file mode 100644
index 00000000000..f90679094d7
--- /dev/null
+++ b/cli/azd/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2012-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.samples.petclinic.system;
+
+import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.cache.configuration.MutableConfiguration;
+
+/**
+ * Cache configuration intended for caches providing the JCache API. This configuration
+ * creates the used cache for the application and enables statistics that become
+ * accessible via JMX.
+ */
+@Configuration(proxyBeanMethods = false)
+@EnableCaching
+class CacheConfiguration {
+
+ @Bean
+ public JCacheManagerCustomizer petclinicCacheConfigurationCustomizer() {
+ return cm -> cm.createCache("vets", cacheConfiguration());
+ }
+
+ /**
+ * Create a simple configuration that enable statistics via the JCache programmatic
+ * configuration API.
+ *
+ * Within the configuration object that is provided by the JCache API standard, there
+ * is only a very limited set of configuration options. The really relevant
+ * configuration options (like the size limit) must be set via a configuration
+ * mechanism that is provided by the selected JCache implementation.
+ */
+ private javax.cache.configuration.Configuration