App Services
Setup handmatig
App Service voor CMS
- Naam = app-[naam-omgeving]-cms
- Enable Application Insights en gebruik deze General Settings:
| Naam | Waarde |
|---|---|
| .NET Framework version | ASP.NET V4.8 |
| Platform | 64 Bit |
| Managed pipeline version | Integrated |
| FTP state | Disabled |
| HTTP version | 2.0 |
| Web sockets | Off |
| Always on | Off |
| ARR affinity | Off |
| Remote debugging | Off |
| Client certificate mode | Ignore |
| Certificate exclusion paths | (leeg) |
- Maak CNAME van
naam-omgeving-cms.iproxapi.nlnaarapp-[naam-omgeving]-cms.azurewebsites.net. - Zet TLS settings op HTTPS only.
- Pas de hostname
naam-omgeving-cms.iproxapi.nltoe, inclusief koppelen van*.iproxapi.nlcertificaat. - Neem overige appsettings en connectionstrings over vanuit het template op Environment variables templates met aanpassing van database gegevens.
- Indien het een productieomgeving betreft, maak een nieuw deployment slot met een kloon van de instellingen.
- Indien het een productieomgeving betreft, stel de volgende applicatieinstelling in op het secundaire deployment slot:
disable_hangfire_backgroundjobsmet waardetrue. Het vinkjeDeployment slot settingmoet ingeschakeld zijn.
App Service voor API
- General settings
| Naam | Waarde |
|---|---|
| Stack | .NET Core |
| Platform | 64 Bit |
| Managed pipeline version | Integrated |
| FTP state | Disabled |
| HTTP version | 2.0 |
| Web sockets | Off |
| Always on | On |
| ARR affinity | Off |
| Remote debugging | Off |
| Client certificate mode | Ignore |
- Overige settings conform template op Environment variables templates.
- 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:
- ts-iprox-openapi-api-acceptatie
- ts-iprox-openapi-api-productie
- ts-iprox-openapi-cms-acceptatie
- ts-iprox-openapi-cms-productie
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.netapp-[site_name]-acc.azurewebsites.netapp-[site_name]-prod-cms.azurewebsites.netapp-[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