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

graduate data protection #3929

Merged
merged 8 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cli/azd/pkg/apphost/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ func Containers(manifest *Manifest) map[string]genContainer {
}

type AppHostOptions struct {
AutoConfigureDataProtection bool
}

// ContainerAppManifestTemplateForProject returns the container app manifest template for a given project.
Expand All @@ -180,7 +179,6 @@ func ContainerAppManifestTemplateForProject(
var buf bytes.Buffer

tmplCtx := generator.containerAppTemplateContexts[projectName]
tmplCtx.AutoConfigureDataProtection = options.AutoConfigureDataProtection

err := genTemplates.ExecuteTemplate(&buf, "containerApp.tmpl.yaml", tmplCtx)
if err != nil {
Expand Down
17 changes: 8 additions & 9 deletions cli/azd/pkg/apphost/generate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,14 @@ type genBicepTemplateContext struct {
}

type genContainerAppManifestTemplateContext struct {
Name string
Ingress *genContainerAppIngress
Env map[string]string
Secrets map[string]string
KeyVaultSecrets map[string]string
Dapr *genContainerAppManifestTemplateContextDapr
AutoConfigureDataProtection bool
Args []string
Volumes []*Volume
Name string
Ingress *genContainerAppIngress
Env map[string]string
Secrets map[string]string
KeyVaultSecrets map[string]string
Dapr *genContainerAppManifestTemplateContextDapr
Args []string
Volumes []*Volume
}

type genProjectFileContext struct {
Expand Down
4 changes: 4 additions & 0 deletions cli/azd/pkg/apphost/testdata/TestAspireArgsGeneration.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
api-version: 2024-02-02-preview
location: {{ .Env.AZURE_LOCATION }}
identity:
type: UserAssigned
Expand All @@ -8,6 +9,9 @@ properties:
environmentId: {{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}
configuration:
activeRevisionsMode: single
runtime:
dotnet:
autoConfigureDataProtection: true
ingress:
external: false
targetPort: {{ targetPortOrDefault 8080 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
api-version: 2024-02-02-preview
location: {{ .Env.AZURE_LOCATION }}
identity:
type: UserAssigned
Expand All @@ -8,6 +9,9 @@ properties:
environmentId: {{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}
configuration:
activeRevisionsMode: single
runtime:
dotnet:
autoConfigureDataProtection: true
ingress:
external: false
targetPort: {{ targetPortOrDefault 8080 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
api-version: 2024-02-02-preview
location: {{ .Env.AZURE_LOCATION }}
identity:
type: UserAssigned
Expand All @@ -8,6 +9,9 @@ properties:
environmentId: {{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}
configuration:
activeRevisionsMode: single
runtime:
dotnet:
autoConfigureDataProtection: true
ingress:
external: false
targetPort: {{ targetPortOrDefault 3306 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
api-version: 2024-02-02-preview
location: {{ .Env.AZURE_LOCATION }}
identity:
type: UserAssigned
Expand All @@ -8,6 +9,9 @@ properties:
environmentId: {{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}
configuration:
activeRevisionsMode: single
runtime:
dotnet:
autoConfigureDataProtection: true
ingress:
additionalPortMappings:
- targetPort: 3306
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
api-version: 2024-02-02-preview
location: {{ .Env.AZURE_LOCATION }}
identity:
type: UserAssigned
Expand All @@ -8,6 +9,9 @@ properties:
environmentId: {{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}
configuration:
activeRevisionsMode: single
runtime:
dotnet:
autoConfigureDataProtection: true
ingress:
external: false
targetPort: {{ targetPortOrDefault 3306 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
api-version: 2024-02-02-preview
location: {{ .Env.AZURE_LOCATION }}
identity:
type: UserAssigned
Expand All @@ -8,6 +9,9 @@ properties:
environmentId: {{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}
configuration:
activeRevisionsMode: single
runtime:
dotnet:
autoConfigureDataProtection: true
ingress:
external: true
targetPort: {{ targetPortOrDefault 8080 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
api-version: 2024-02-02-preview
location: {{ .Env.AZURE_LOCATION }}
identity:
type: UserAssigned
Expand All @@ -8,6 +9,9 @@ properties:
environmentId: {{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}
configuration:
activeRevisionsMode: single
runtime:
dotnet:
autoConfigureDataProtection: true
ingress:
external: true
targetPort: {{ targetPortOrDefault 3000 }}
Expand Down
4 changes: 4 additions & 0 deletions cli/azd/pkg/apphost/testdata/TestAspireEscaping-api.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
api-version: 2024-02-02-preview
location: {{ .Env.AZURE_LOCATION }}
identity:
type: UserAssigned
Expand All @@ -8,6 +9,9 @@ properties:
environmentId: {{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}
configuration:
activeRevisionsMode: single
runtime:
dotnet:
autoConfigureDataProtection: true
ingress:
external: false
targetPort: {{ targetPortOrDefault 8080 }}
Expand Down
6 changes: 1 addition & 5 deletions cli/azd/pkg/project/dotnet_importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ func (ai *DotNetImporter) Services(
return services, nil
}

var autoConfigureDataProtectionFeature = alpha.MustFeatureKey("aspire.autoConfigureDataProtection")

func (ai *DotNetImporter) SynthAllInfrastructure(
ctx context.Context, p *ProjectConfig, svcConfig *ServiceConfig,
) (fs.FS, error) {
Expand Down Expand Up @@ -339,9 +337,7 @@ func (ai *DotNetImporter) SynthAllInfrastructure(
// container we will deploy.
writeManifestForResource := func(name string) error {
containerAppManifest, err := apphost.ContainerAppManifestTemplateForProject(
manifest, name, apphost.AppHostOptions{
AutoConfigureDataProtection: ai.alphaFeatureManager.IsEnabled(autoConfigureDataProtectionFeature),
})
manifest, name, apphost.AppHostOptions{})
if err != nil {
return fmt.Errorf("generating containerApp.tmpl.yaml for resource %s: %w", name, err)
}
Expand Down
4 changes: 1 addition & 3 deletions cli/azd/pkg/project/service_target_dotnet_containerapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ func (at *dotnetContainerAppTarget) Deploy(
generatedManifest, err := apphost.ContainerAppManifestTemplateForProject(
serviceConfig.DotNetContainerApp.Manifest,
serviceConfig.DotNetContainerApp.ProjectName,
apphost.AppHostOptions{
AutoConfigureDataProtection: at.alphaFeatureManager.IsEnabled(autoConfigureDataProtectionFeature),
},
apphost.AppHostOptions{},
)
if err != nil {
task.SetError(fmt.Errorf("generating container app manifest: %w", err))
Expand Down
2 changes: 0 additions & 2 deletions cli/azd/resources/alpha_features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
description: "Support infrastructure deployments at resource group scope."
- id: infraSynth
description: "Enable the `infra synth` command to write generated infrastructure to disk."
- id: aspire.autoConfigureDataProtection
description: "Automatically configure data protection for Aspire deployments. May not be supported in all regions."
- id: aks.helm
description: "Enable Helm support for AKS deployments."
- id: aks.kustomize
Expand Down
4 changes: 0 additions & 4 deletions cli/azd/resources/apphost/templates/containerApp.tmpl.yamlt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{{define "containerApp.tmpl.yaml" -}}
{{- if .AutoConfigureDataProtection -}}
api-version: 2024-02-02-preview
{{end -}}
location: {{ "{{ .Env.AZURE_LOCATION }}" }}
identity:
type: UserAssigned
Expand All @@ -12,11 +10,9 @@ properties:
environmentId: {{ "{{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}" }}
configuration:
activeRevisionsMode: single
{{- if .AutoConfigureDataProtection}}
runtime:
dotnet:
autoConfigureDataProtection: true
{{- end}}
{{- if .Dapr}}
dapr:
appId: {{ .Dapr.AppId }}
Expand Down

Large diffs are not rendered by default.

Loading
Loading