Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC: Adds Kustomize support with azd and AKS #3048

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
84b2ecc
Bump @adobe/css-tools in /templates/todo/web/react-fluent (#3043)
dependabot[bot] Dec 2, 2023
4f93828
Makes default dashboard optional when name parameter is specified (#3…
pamelafox Dec 2, 2023
a16a69e
adding target for docker build (#3052)
Petermarcu Dec 4, 2023
a524be8
Fix init to not consider parent directories. (#3038)
weikanglim Dec 4, 2023
ad20160
console: handle interrupt to unhide cursor (#3045)
weikanglim Dec 5, 2023
885ce46
aspire: Enable Admin User on Container Registry (#3069)
ellismg Dec 5, 2023
67cfc5a
aspire: Publish projects as framework dependent (#3047)
ellismg Dec 5, 2023
be33f81
persist os env sub and location to env file during ensureEnv (#3049)
vhvb1989 Dec 6, 2023
4434c90
Setting RG env var for CI when it is set on env (#3056)
vhvb1989 Dec 7, 2023
b14e180
aspire: Better error msg for missing containerPort in binding (#3071)
weikanglim Dec 7, 2023
8e7b6c2
Remove Old C# Sample per @jongio (#3046)
isaacrlevin Dec 8, 2023
dde6bc3
aspire: Add support for `dockerfile.v0` (#3075)
ellismg Dec 8, 2023
eedc471
add missing dependency (DI issue) (#3106)
vhvb1989 Dec 11, 2023
90a0f04
use service-connection for azdo (#3100)
vhvb1989 Dec 11, 2023
a029661
Ensure azd env name is synchronized to .env file (#3041)
wbreza Dec 12, 2023
cb86a7d
aspire: Improve binding expression evaluator (#3095)
ellismg Dec 12, 2023
f385e0b
buildpacks: Update dotnet base image to bullseye (#3112)
weikanglim Dec 13, 2023
8959d03
Update .NET samples to .NET 8 and Minimal API (#3017)
isaacrlevin Dec 13, 2023
7f10b1f
changelog for 1.5.1 (#3113)
hemarina Dec 13, 2023
0a1faee
Update azure.yaml.json so support target (#3057)
Petermarcu Dec 13, 2023
f1e1c9c
fix schema (#3114)
vhvb1989 Dec 13, 2023
762b884
ephemeral spinner for loading locations (#3118)
weikanglim Dec 14, 2023
c449eeb
Do not require `docker login` for Aspire apps (#3014)
ellismg Dec 14, 2023
b4ea8bd
aspire: Do not error when other projects present (#3117)
weikanglim Dec 14, 2023
db36700
Configure ACA based on Dapr-related resources of Aspire manifests (#2…
philliphoff Dec 15, 2023
475ef58
Enable more tests for recording (#3122)
weikanglim Dec 15, 2023
6e8d2ef
Fixing gitignore for .NET ecosystem (#3029)
timheuer Dec 17, 2023
57830d7
bicep core: Serialize updates for config-appsettings and config-logs(…
weikanglim Dec 18, 2023
7ab9a99
Fix container-template calling template-functions with yaml marshalli…
vhvb1989 Dec 19, 2023
bd8aefb
aspire: Support inputs and improve container.v0 support (#3131)
ellismg Dec 19, 2023
fbbcfbe
daily (#3133)
vhvb1989 Dec 19, 2023
a73df39
Fix incorrect log analytics dependency (#3145)
weikanglim Dec 20, 2023
8237202
[NetAspire] Fix storage overriding after reading manifest (#3147)
vhvb1989 Dec 20, 2023
ad35a54
increase resiliency of install script (#3146)
weikanglim Dec 20, 2023
7e15fef
py-func: upgrade packages and function-host runtime (#3148)
weikanglim Dec 20, 2023
3856d1e
cl date update for release 151 (#3149)
vhvb1989 Dec 20, 2023
5475227
Increment CLI version after release (#3151)
azure-sdk Dec 20, 2023
5f3afc0
mem ali (#3152)
vhvb1989 Dec 22, 2023
f0d9864
Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#3132)
dependabot[bot] Dec 22, 2023
df69a8c
Update `azd auth login` for `--no-prompt --use-device-code` combo to …
vhvb1989 Dec 26, 2023
a0bf60d
association for .bicept as go-template and extension for syntax (#3163)
vhvb1989 Jan 3, 2024
278a252
net aspire support cosmos (#3164)
vhvb1989 Jan 4, 2024
509f75a
display mysql flexible server (#3170)
john0isaac Jan 4, 2024
ffacf72
Enable admin user for registry in ACA sample (#3178)
ellismg Jan 9, 2024
9e05ef2
feat: add gha schema lint (#3172)
john0isaac Jan 9, 2024
56cc9b8
Bump follow-redirects in /templates/todo/web/react-fluent (#3186)
dependabot[bot] Jan 10, 2024
e086a36
Update CODEOWNERS to narrow distribution for @jongio (#3188)
danieljurek Jan 11, 2024
15c8220
`npm update @vscode/test-electron` and `npm audit fix` (#3192)
bwateratmsft Jan 11, 2024
6277a4c
WIP
wbreza Nov 18, 2023
073d20d
install helm repo/release
wbreza Nov 21, 2023
4f62938
Fixes lint issues
wbreza Nov 21, 2023
0f41ac5
Minor refactoring
wbreza Nov 21, 2023
b39f1a7
Adds version flag to helm upgrade
wbreza Nov 21, 2023
e835933
WIP: customize
wbreza Dec 1, 2023
853efd2
rebased from helm and integrates kustomize
wbreza Dec 2, 2023
c4088fb
Adds full support for 'ExternalTool' interface
wbreza Dec 4, 2023
191c35e
Adds JSON schema for helm & kustomize in azure.yaml
wbreza Dec 4, 2023
c543a56
Adds missing return statement after setting task error
wbreza Dec 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"golang.go",
"ms-azuretools.vscode-bicep",
"eamodio.gitlens",
"hashicorp.terraform"
"hashicorp.terraform",
"jinliming2.vscode-go-template"
]
}
}
Expand Down
7 changes: 5 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@

/ext/ @karolz-ms @ellismg

/generators/repo/ @wbreza @ellismg @danieljurek @jongio
/generators/repo/ @wbreza @ellismg @danieljurek

/.github/ @danieljurek @ellismg

/eng/ @danieljurek @ellismg

/schemas/ @jongio @karolz-ms @ellismg @wbreza
/schemas/ @karolz-ms @ellismg @wbreza

/templates/ @jongio @wbreza

# Exclude @jongio from version bump PRs opened by dependabot
/templates/**/package-lock.json @wbreza
22 changes: 22 additions & 0 deletions .github/workflows/schema-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: schema-ci

on:
pull_request:
paths:
- "schemas/**"
branches: [main]

permissions:
contents: read

jobs:
schema-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "18"
- run: npm install -g jsonlint
- name: Validate schemas JSON
run: jsonlint schemas/**/*.json -c
1 change: 1 addition & 0 deletions .vscode/cspell.global.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ignoreWords:
- conjunction
- containerregistry
- containerservice
- dapr
- databricks
- dedb
- devcenter
Expand Down
14 changes: 8 additions & 6 deletions cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM --platform=amd64 mcr.microsoft.com/dotnet/sdk:6.0
FROM --platform=amd64 mcr.microsoft.com/dotnet/sdk:8.0

WORKDIR /app

RUN export DEBIAN_FRONTEND=noninteractive \
&& wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb && dpkg -i packages-microsoft-prod.deb \
&& apt-get update && apt-get install -y --no-install-recommends apt-utils && apt-get install -y apt-transport-https ca-certificates curl unzip procps gnupg2 software-properties-common lsb-release \
&& apt-get update && apt-get install -y --no-install-recommends apt-utils && apt-get install -y apt-transport-https ca-certificates curl gnupg unzip procps gnupg2 software-properties-common lsb-release \
# functions core tools
&& curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \
&& mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg \
Expand All @@ -17,17 +17,19 @@ RUN export DEBIAN_FRONTEND=noninteractive \
# az cli
&& curl -sSL https://aka.ms/InstallAzureCLIDeb | bash \
# nodejs
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y nodejs \
# python
&& apt-get install -y --no-install-recommends python3-pip python-dev python3-venv \
&& python3 -m pip install --upgrade pip \
&& apt-get install -y --no-install-recommends python3-pip python3-venv \
&& echo 'alias python=python3' >> ~/.bashrc \
&& echo 'alias pip=pip3' >> ~/.bashrc \
# java
&& apt-get update && apt-get install -y msopenjdk-17 \
# terraform cli
&& apt-get update && apt-get install -y gnupg software-properties-common \
&& apt-get update && apt-get install -y software-properties-common \
&& wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
tee /usr/share/keyrings/hashicorp-archive-keyring.gpg \
Expand Down
2 changes: 2 additions & 0 deletions cli/azd/.vscode/cspell-azd-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ devcentersdk
devel
discarder
docf
dockerfiles
dockerproject
doublestar
dskip
Expand Down Expand Up @@ -178,6 +179,7 @@ tracetest
trafficmanager
Truef
typeflag
unhide
unmarshaled
unmarshalling
unsetenvs
Expand Down
7 changes: 7 additions & 0 deletions cli/azd/.vscode/cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ overrides:
- keychain
- crusername
- azurecr
- filename: pkg/tools/dotnet/dotnet.go
words:
- PWORD
- filename: pkg/tools/kubectl/kubectl.go
words:
- tmpl
Expand All @@ -85,6 +88,10 @@ overrides:
- filename: pkg/azsdk/storage/storage_blob_client.go
words:
- azblob
- filename: pkg/project/service_target_aks.go
words:
- kustomization
- templating
ignorePaths:
- "**/*_test.go"
- "**/mock*.go"
3 changes: 2 additions & 1 deletion cli/azd/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"recommendations": [
"golang.go",
"streetsidesoftware.code-spell-checker",
"redhat.vscode-yaml"
"redhat.vscode-yaml",
"jinliming2.vscode-go-template"
]
}
5 changes: 4 additions & 1 deletion cli/azd/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
"go.lintFlags": ["--fast"],
"go.lintOnSave": "package",
"go.lintTool": "golangci-lint",
"go.testTimeout": "10m"
"go.testTimeout": "10m",
"files.associations": {
"*.bicept": "go-template"
}
}
27 changes: 25 additions & 2 deletions cli/azd/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,39 @@

### Features Added

- [[2998]](https://github.com/Azure/azure-dev/pull/2998) Adds support for Azure Storage Tables and Queues on Aspire projects.

### Breaking Changes

### Bugs Fixed

### Other Changes

## 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
Expand Down Expand Up @@ -658,6 +680,7 @@ We plan to improve this behavior with [[#1126]](https://github.com/Azure/azure-d
- [[#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)
Expand Down
10 changes: 9 additions & 1 deletion cli/azd/cmd/auth_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,15 @@ func (la *loginAction) login(ctx context.Context) error {

if useDevCode {
_, err := la.authManager.LoginWithDeviceCode(ctx, la.flags.tenantID, la.flags.scopes, func(url string) error {
openWithDefaultBrowser(ctx, la.console, url)
if !la.flags.global.NoPrompt {
la.console.Message(ctx, "Then press enter and continue to log in from your browser...")
la.console.WaitForEnter()
openWithDefaultBrowser(ctx, la.console, url)
return nil
}
// For no-prompt, Just provide instructions without trying to open the browser
// If manual browsing is enabled, we don't want to open the browser automatically
la.console.Message(ctx, fmt.Sprintf("Then, go to: %s", url))
return nil
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cli/azd/cmd/auth_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func getTenantIdFromAzdEnv(
if err != nil {
return tenantId, fmt.Errorf(
"resolving the Azure Directory from azd environment (%s): %w",
azdEnv.GetEnvName(),
azdEnv.Name(),
err)
}

Expand Down
12 changes: 11 additions & 1 deletion cli/azd/cmd/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ import (
"github.com/azure/azure-dev/cli/azd/pkg/environment"
"github.com/azure/azure-dev/cli/azd/pkg/environment/azdcontext"
"github.com/azure/azure-dev/cli/azd/pkg/exec"
"github.com/azure/azure-dev/cli/azd/pkg/helm"
"github.com/azure/azure-dev/cli/azd/pkg/httputil"
"github.com/azure/azure-dev/cli/azd/pkg/infra"
"github.com/azure/azure-dev/cli/azd/pkg/infra/provisioning"
"github.com/azure/azure-dev/cli/azd/pkg/input"
"github.com/azure/azure-dev/cli/azd/pkg/ioc"
"github.com/azure/azure-dev/cli/azd/pkg/kustomize"
"github.com/azure/azure-dev/cli/azd/pkg/lazy"
"github.com/azure/azure-dev/cli/azd/pkg/output"
"github.com/azure/azure-dev/cli/azd/pkg/pipeline"
Expand Down Expand Up @@ -446,6 +448,8 @@ func registerCommonDependencies(container *ioc.NestedContainer) {
container.RegisterSingleton(github.NewGitHubCli)
container.RegisterSingleton(javac.NewCli)
container.RegisterSingleton(kubectl.NewKubectl)
container.RegisterSingleton(helm.NewCli)
container.RegisterSingleton(kustomize.NewCli)
container.RegisterSingleton(maven.NewMavenCli)
container.RegisterSingleton(npm.NewNpmCli)
container.RegisterSingleton(python.NewPythonCli)
Expand Down Expand Up @@ -480,7 +484,7 @@ func registerCommonDependencies(container *ioc.NestedContainer) {

// Languages
frameworkServiceMap := map[project.ServiceLanguageKind]any{
"": project.NewDotNetProject,
project.ServiceLanguageNone: project.NewNoneProject,
project.ServiceLanguageDotNet: project.NewDotNetProject,
project.ServiceLanguageCsharp: project.NewDotNetProject,
project.ServiceLanguageFsharp: project.NewDotNetProject,
Expand All @@ -497,6 +501,12 @@ func registerCommonDependencies(container *ioc.NestedContainer) {
}
}

err := container.RegisterNamedSingleton(
string(project.ServiceLanguageDocker), project.NewDockerProjectAsFrameworkService)
if err != nil {
panic(fmt.Errorf("registering docker framework service: %w", err))
}

// Pipelines
container.RegisterSingleton(pipeline.NewPipelineManager)
container.RegisterSingleton(func(flags *pipelineConfigFlags) *pipeline.PipelineManagerArgs {
Expand Down
4 changes: 2 additions & 2 deletions cli/azd/cmd/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func (en *envNewAction) Run(ctx context.Context) (*actions.ActionResult, error)
return nil, fmt.Errorf("creating new environment: %w", err)
}

if err := en.azdCtx.SetDefaultEnvironmentName(env.GetEnvName()); err != nil {
if err := en.azdCtx.SetDefaultEnvironmentName(env.Name()); err != nil {
return nil, fmt.Errorf("saving default environment: %w", err)
}

Expand Down Expand Up @@ -432,7 +432,7 @@ func newEnvRefreshAction(
func (ef *envRefreshAction) Run(ctx context.Context) (*actions.ActionResult, error) {
// Command title
ef.console.MessageUxItem(ctx, &ux.MessageTitle{
Title: fmt.Sprintf("Refreshing environment %s (azd env refresh)", ef.env.GetEnvName()),
Title: fmt.Sprintf("Refreshing environment %s (azd env refresh)", ef.env.Name()),
})

if err := ef.projectManager.Initialize(ctx, ef.projectConfig); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cli/azd/cmd/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (hra *hooksRunAction) Run(ctx context.Context) (*actions.ActionResult, erro
TitleNote: fmt.Sprintf(
"Finding and executing %s hooks for environment %s",
output.WithHighLightFormat(hookName),
output.WithHighLightFormat(hra.env.GetEnvName()),
output.WithHighLightFormat(hra.env.Name()),
),
})

Expand Down
9 changes: 3 additions & 6 deletions cli/azd/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,8 @@ func (i *initAction) Run(ctx context.Context) (*actions.ActionResult, error) {
return nil, fmt.Errorf("getting cwd: %w", err)
}

azdCtx, err := i.lazyAzdCtx.GetValue()
if err != nil {
azdCtx = azdcontext.NewAzdContextWithDirectory(wd)
i.lazyAzdCtx.SetValue(azdCtx)
}
azdCtx := azdcontext.NewAzdContextWithDirectory(wd)
i.lazyAzdCtx.SetValue(azdCtx)

if i.flags.templateBranch != "" && i.flags.templatePath == "" {
return nil,
Expand Down Expand Up @@ -359,7 +356,7 @@ func (i *initAction) initializeEnv(
return nil, fmt.Errorf("loading environment: %w", err)
}

if err := azdCtx.SetDefaultEnvironmentName(env.GetEnvName()); err != nil {
if err := azdCtx.SetDefaultEnvironmentName(env.Name()); err != nil {
return nil, fmt.Errorf("saving default environment: %w", err)
}

Expand Down
8 changes: 3 additions & 5 deletions cli/azd/cmd/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (m *monitorAction) Run(ctx context.Context) (*actions.ActionResult, error)

resourceManager := infra.NewAzureResourceManager(m.azCli, m.deploymentOperations)
resourceGroups, err := resourceManager.GetResourceGroupsForEnvironment(
ctx, m.env.GetSubscriptionId(), m.env.GetEnvName())
ctx, m.env.GetSubscriptionId(), m.env.Name())
if err != nil {
return nil, fmt.Errorf("discovering resource groups from deployment: %w", err)
}
Expand Down Expand Up @@ -142,8 +142,7 @@ func (m *monitorAction) Run(ctx context.Context) (*actions.ActionResult, error)
for _, insightsResource := range insightsResources {
if m.flags.monitorLive {
openWithDefaultBrowser(ctx, m.console,
fmt.Sprintf("https://app.azure.com/%s%s/quickPulse", tenantId, insightsResource.Id),
)
fmt.Sprintf("https://app.azure.com/%s%s/quickPulse", tenantId, insightsResource.Id))
}

if m.flags.monitorLogs {
Expand All @@ -155,8 +154,7 @@ func (m *monitorAction) Run(ctx context.Context) (*actions.ActionResult, error)
for _, portalResource := range portalResources {
if m.flags.monitorOverview {
openWithDefaultBrowser(ctx, m.console,
fmt.Sprintf("https://portal.azure.com/#@%s/dashboard/arm%s", tenantId, portalResource.Id),
)
fmt.Sprintf("https://portal.azure.com/#@%s/dashboard/arm%s", tenantId, portalResource.Id))
}
}

Expand Down