Closed davidfowl closed 3 days ago
We should move container resources to yaml the docker files and projects
We'll need to place these in the same directory as the app host when we infra synth
them.
We'll also need to update the project importer logic so that these are pushed up during azd deploy
, by creating synthetic projects for them.
Will be fixed by #3820. The generated cache.tmpl.yaml
file looks like this now:
location: {{ .Env.AZURE_LOCATION }}
identity:
type: UserAssigned
userAssignedIdentities:
? "{{ .Env.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID }}"
: {}
properties:
environmentId: {{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}
configuration:
activeRevisionsMode: single
ingress:
external: false
targetPort: {{ targetPortOrDefault 6379 }}
transport: tcp
allowInsecure: false
registries:
- server: {{ .Env.AZURE_CONTAINER_REGISTRY_ENDPOINT }}
identity: {{ .Env.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID }}
template:
containers:
- image: {{ .Image }}
name: cache
env:
- name: AZURE_CLIENT_ID
value: {{ .Env.MANAGED_IDENTITY_CLIENT_ID }}
- name: REDIS_EP
value: tcp://cache.internal.{{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_DEFAULT_DOMAIN }}:6379
scale:
minReplicas: 1
tags:
azd-service-name: cache
aspire-resource-name: cache
@ellismg I'd like to only emit the managed identity good if we need to. That might be a longer-term fix though as it requires knowing a if any bicep based resources are referenced.
Aspire Container resources end up being generated in the provision phases of azd deployments. This causes problems when environment variables refer to project urls. We end up with go templates in the bicep definition which fail to be evaluated. We should move container resources to yaml the docker files and projects