Ga naar hoofdinhoud

App Services

Setup handmatig

App Service voor CMS

  1. Naam = app-[naam-omgeving]-cms
  2. Enable Application Insights en gebruik deze General Settings:
NaamWaarde
.NET Framework versionASP.NET V4.8
Platform64 Bit
Managed pipeline versionIntegrated
FTP stateDisabled
HTTP version2.0
Web socketsOff
Always onOff
ARR affinityOff
Remote debuggingOff
Client certificate modeIgnore
Certificate exclusion paths(leeg)
  1. Maak CNAME van naam-omgeving-cms.iproxapi.nl naar app-[naam-omgeving]-cms.azurewebsites.net.
  2. Zet TLS settings op HTTPS only.
  3. Pas de hostname naam-omgeving-cms.iproxapi.nl toe, inclusief koppelen van *.iproxapi.nl certificaat.
  4. Neem overige appsettings en connectionstrings over vanuit het template op Environment variables templates met aanpassing van database gegevens.
  5. Indien het een productieomgeving betreft, maak een nieuw deployment slot met een kloon van de instellingen.
  6. Indien het een productieomgeving betreft, stel de volgende applicatieinstelling in op het secundaire deployment slot: disable_hangfire_backgroundjobs met waarde true. Het vinkje Deployment slot setting moet ingeschakeld zijn.

App Service voor API

  1. General settings
NaamWaarde
Stack.NET Core
Platform64 Bit
Managed pipeline versionIntegrated
FTP stateDisabled
HTTP version2.0
Web socketsOff
Always onOn
ARR affinityOff
Remote debuggingOff
Client certificate modeIgnore
  1. Overige settings conform template op Environment variables templates.
  2. Indien het een productieomgeving betreft, maak een nieuw deployment slot met een kloon van de instellingen.

Extra configuratie eigenschappen

Indien de basis URL voor Swagger afwijkt moet ook Documentation:RoutePrefix toegevoegd worden. Dit kan bijvoorbeeld de waarde api-docs bevatten.

Setup automatisch

Template Specs

Voor de App Services die hierboven beschreven staan bestaan Template Specs in de iprox Resource Group. Deze kunnen zo nodig aangepast worden als het sjabloon anders moet worden.

De Template Specs zijn:

Azure CLI

Om een volledige straat uit te rollen kan het handig zijn om een PowerShell script te maken. Hieronder volgt een voorbeeld. Een aanroep zou kunnen zijn:

 .\iprox-deploy-openapi.ps1 -name TestAPI202102011506 -subscription IPROX -resourceGroup iprox

Bedenk wel dat géén van de combinaties

  • app-[site_name]-prod.azurewebsites.net
  • app-[site_name]-acc.azurewebsites.net
  • app-[site_name]-prod-cms.azurewebsites.net
  • app-[site_name]-acc-cms.azurewebsites.net

Bezet mag zijn.

iprox-deploy-openapi.ps1

Param
(
[parameter(Position=0, Mandatory=$true)]
[String]
$subscription = $(throw "Subscription is required. Usage Example: .\iprox-deploy-openapi.ps1 -subscription SubName"),

[parameter(Position=0, Mandatory=$true)]
[String]
$resourceGroup = $(throw "Resource Group is required. Usage Example: .\iprox-deploy-openapi.ps1 -resourceGroup ResGrpName"),

[parameter(Position=1, Mandatory=$true)]
[String]
$name = $(throw "Name is required. Usage Example: .\iprox-deploy-openapi.ps1 -name Name")
)
$name_acc_cms = "app-" + $name + "-acc-cms"
$name_prod_cms = "app-" + $name + '-prod-cms'
$name_acc_api = "app-" + $name + "-acc"
$name_prod_api = "app-" + $name + "-prod"
Write-Host ("Subscription: " + $subscription)
Write-Host ("Resource group: " + $resourceGroup)
Write-Host ("Name: " + $name)

function Deploy-OpenApi-AppService {
Param
(
[parameter(Position=0, Mandatory=$true)]
$templateSpecId,

[parameter(Position=1, Mandatory=$true)]
[String]
$siteName
)

az deployment group create `
--subscription $subscription `
--resource-group $resourceGroup `
--template-spec $templateSpecId `
--parameters site_name=$siteName
}

# CMS Acceptatie
$iprox_openapi_cms_acceptatie_id = $(az ts show --name ts-iprox-openapi-cms-acceptatie --subscription IPROX --resource-group iprox --version "1.0" --query "id")
Write-Host ("Deploying Template Specification with ID " + $iprox_openapi_cms_acceptatie_id)
Deploy-OpenApi-AppService -templateSpecId $iprox_openapi_cms_acceptatie_id -siteName $name_acc_cms

# API Acceptatie
$iprox_openapi_api_acceptatie_id = $(az ts show --name ts-iprox-openapi-api-acceptatie --subscription IPROX --resource-group iprox --version "1.0" --query "id")
Write-Host ("Deploying Template Specification with ID " + $iprox_openapi_api_acceptatie_id)
Deploy-OpenApi-AppService -templateSpecId $iprox_openapi_api_acceptatie_id -siteName $name_acc_api

# CMS Productie
$iprox_openapi_cms_productie_id = $(az ts show --name ts-iprox-openapi-cms-productie --subscription IPROX --resource-group iprox --version "1.0" --query "id")
Write-Host ("Deploying Template Specification with ID " + $iprox_openapi_cms_productie_id)
Deploy-OpenApi-AppService -templateSpecId $iprox_openapi_cms_productie_id -siteName $name_prod_cms

# API Productie
$iprox_openapi_api_productie_id = $(az ts show --name ts-iprox-openapi-api-productie --subscription IPROX --resource-group iprox --version "1.0" --query "id")
Write-Host ("Deploying Template Specification with ID " + $iprox_openapi_api_productie_id)
Deploy-OpenApi-AppService -templateSpecId $iprox_openapi_api_productie_id -siteName $name_prod_api