# yaml-language-server: $schema=https://azuresdkreleasepreview.blob.core.windows.net/azd/schema/azure.yaml.json

name: modern-csharp-web
metadata:
  template: modern-csharp-web@1.0.0
hooks:
  preprovision:
    posix:
      interactive: true
      shell: sh
      run: ./infra/scripts/preprovision/validate-params.sh && ./infra/scripts/preprovision/whats-my-ip.sh
    windows:
      interactive: true
      shell: pwsh
      run: ./infra/scripts/preprovision/validate-params.ps1 && ./infra/scripts/preprovision/whats-my-ip.ps1
  postprovision:
    posix:
      interactive: true
      run: ./infra/scripts/postprovision/call-create-app-registrations.sh
    windows:
      interactive: true
      run: ./infra/scripts/postprovision/call-create-app-registrations.ps1
  predeploy:
    posix:
      interactive: true
      shell: sh
      run: ./infra/scripts/predeploy/call-set-app-configuration.sh
    windows:
      interactive: true
      shell: pwsh
      run: ./infra/scripts/predeploy/call-set-app-configuration.ps1
  postdeploy:
    posix:
      interactive: true
      run: ./infra/scripts/postdeploy/show-webapp-uri.sh
    windows:
      interactive: true
      run: ./infra/scripts/postdeploy/show-webapp-uri.ps1
  predown:
    posix:
      interactive: true
      run: ./infra/scripts/predown/call-cleanup.sh
    windows:
      interactive: true
      run: ./infra/scripts/predown/call-cleanup.ps1
services:
  web-callcenter-service:
    project: src/Relecloud.Web.CallCenter.Api
    language: csharp
    host: appservice
  web-callcenter-frontend:
    project: src/Relecloud.Web.CallCenter
    language: csharp
    host: appservice
  rendering-service:
    project: src/Relecloud.TicketRenderer
    language: dotnet
    host: containerapp
    apiVersion: 2024-02-02-preview # Force `azd` to use this API version for GET/PATCH operations
    docker:
      # These paths are relative to the project directory
      path: ./Dockerfile
      context: ./../
