chore(azure): remove Log Analytics Workspace from infra
Simplifies infrastructure: ACR + Container Apps Environment only. Log Analytics can be added later if observability is needed. Update INSTALL.md accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cb04f26be7
commit
f9b5f79747
|
|
@ -87,7 +87,7 @@ Fes login amb usuari `demo` i la `DEMO_PASSWORD` que has configurat.
|
||||||
azure/
|
azure/
|
||||||
├── config.sh.example # plantilla de configuració (commited al repo)
|
├── config.sh.example # plantilla de configuració (commited al repo)
|
||||||
├── config.sh # valors reals amb secrets (NO comitejar mai — gitignored)
|
├── config.sh # valors reals amb secrets (NO comitejar mai — gitignored)
|
||||||
├── infra.bicep # infraestructura base: ACR + Log Analytics + Container Apps Env
|
├── infra.bicep # infraestructura base: ACR + Container Apps Env
|
||||||
├── container-app.bicep # Container App: es re-desplega a cada nova versió
|
├── container-app.bicep # Container App: es re-desplega a cada nova versió
|
||||||
├── 1-infra.sh # script pas 1: crea la infraestructura (una sola vegada)
|
├── 1-infra.sh # script pas 1: crea la infraestructura (una sola vegada)
|
||||||
└── 2-build-deploy.sh # script pas 2: build Docker + push + deploy (cada versió)
|
└── 2-build-deploy.sh # script pas 2: build Docker + push + deploy (cada versió)
|
||||||
|
|
@ -152,7 +152,6 @@ Aquest script crea al resource group `rg_mirofish`:
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| Resource Group | `rg_mirofish` | Contenidor de tots els recursos |
|
| Resource Group | `rg_mirofish` | Contenidor de tots els recursos |
|
||||||
| Container Registry | `mirofsihacr` | Registre privat Docker (SKU Basic) |
|
| Container Registry | `mirofsihacr` | Registre privat Docker (SKU Basic) |
|
||||||
| Log Analytics Workspace | `mirofish-logs` | Logs centralitzats (90 dies retenció) |
|
|
||||||
| Container Apps Environment | `mirofish-env` | Plataforma d'execució de contenidors |
|
| Container Apps Environment | `mirofish-env` | Plataforma d'execució de contenidors |
|
||||||
|
|
||||||
Al final imprimeix l'ACR Login Server i l'ID de l'entorn. Guarda'ls si els necessites.
|
Al final imprimeix l'ACR Login Server i l'ID de l'entorn. Guarda'ls si els necessites.
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,7 @@
|
||||||
//
|
//
|
||||||
// Crea:
|
// Crea:
|
||||||
// - Azure Container Registry (ACR) per emmagatzemar la imatge Docker
|
// - Azure Container Registry (ACR) per emmagatzemar la imatge Docker
|
||||||
// - Log Analytics Workspace (NOR0016-C: 90 dies retenció)
|
// - Container Apps Environment (plataforma d'execució)
|
||||||
// - Container Apps Environment (plataforma d'execució CTTI)
|
|
||||||
//
|
//
|
||||||
// Executar amb: azure/1-infra.sh
|
// Executar amb: azure/1-infra.sh
|
||||||
// ─────────────────────────────────────────────────────────────────────────────
|
// ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
@ -24,20 +23,7 @@ resource acr 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' = {
|
||||||
name: 'Basic'
|
name: 'Basic'
|
||||||
}
|
}
|
||||||
properties: {
|
properties: {
|
||||||
adminUserEnabled: true // necessari per a la autenticació des dels scripts
|
adminUserEnabled: true // necessari per a l'autenticació des dels scripts
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ─── Log Analytics Workspace ──────────────────────────────────────────────────
|
|
||||||
// NOR0016-C: retenció mínima de logs de seguretat = 90 dies
|
|
||||||
resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
|
|
||||||
name: '${projectName}-logs'
|
|
||||||
location: location
|
|
||||||
properties: {
|
|
||||||
sku: {
|
|
||||||
name: 'PerGB2018'
|
|
||||||
}
|
|
||||||
retentionInDays: 90
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,31 +31,21 @@ resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
|
||||||
resource containerAppsEnv 'Microsoft.App/managedEnvironments@2023-05-01' = {
|
resource containerAppsEnv 'Microsoft.App/managedEnvironments@2023-05-01' = {
|
||||||
name: '${projectName}-env'
|
name: '${projectName}-env'
|
||||||
location: location
|
location: location
|
||||||
properties: {
|
properties: {}
|
||||||
appLogsConfiguration: {
|
// TODO (ops): afegir appLogsConfiguration amb Log Analytics si es vol observabilitat
|
||||||
destination: 'log-analytics'
|
// TODO (ops): descomentar per integrar en VNet Hub-Spoke
|
||||||
logAnalyticsConfiguration: {
|
// vnetConfiguration: {
|
||||||
customerId: logAnalytics.properties.customerId
|
// infrastructureSubnetId: '/subscriptions/.../subnets/container-apps-subnet'
|
||||||
sharedKey: logAnalytics.listKeys().primarySharedKey
|
// internal: true
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
// TODO (ops): descomentar per integrar en VNet Hub-Spoke CTTI
|
|
||||||
// vnetConfiguration: {
|
|
||||||
// infrastructureSubnetId: '/subscriptions/.../subnets/container-apps-subnet'
|
|
||||||
// internal: true
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Outputs (usats pels scripts de deploy) ───────────────────────────────────
|
// ─── Outputs (usats pels scripts de deploy) ───────────────────────────────────
|
||||||
@description('URL de login de l\'ACR (ex: mirofsihacr.azurecr.io)')
|
@description('URL de login de l\'ACR (ex: mirofsihacr.azurecr.io)')
|
||||||
output acrLoginServer string = acr.properties.loginServer
|
output acrLoginServer string = acr.properties.loginServer
|
||||||
|
|
||||||
@description('Nom del recurs ACR (per a az acr build)')
|
@description('Nom del recurs ACR')
|
||||||
output acrName string = acr.name
|
output acrName string = acr.name
|
||||||
|
|
||||||
@description('ID del Container Apps Environment')
|
@description('ID del Container Apps Environment')
|
||||||
output containerAppsEnvId string = containerAppsEnv.id
|
output containerAppsEnvId string = containerAppsEnv.id
|
||||||
|
|
||||||
@description('ID del Log Analytics Workspace')
|
|
||||||
output logAnalyticsId string = logAnalytics.id
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue