scootr's service to handle SPID authentication.
Note
Before setting the custom domain you need to add these DNS records
CNAME
:Name
: Yourcustom domain
(e.g.: spid.scootr.it.)Value
: Your AzureApp Service URL
(e.g.: scootr.azurewebsites.net.)
TXT
:Name
: Your custom domain with theasuid subdomain
(e.g.: asuid.spid.scootr.it.)Value
: Your CustomDomain Verification ID
(App Service -> Settings -> Custom Domains)
- Create a resource group
az group create --name scootr --location "West Europe"
- Create a Container Registry
az acr create --name scootrregistry --resource-group scootr --sku Basic --admin-enabled true
- Retrieve credentials
az acr credential show --resource-group scootr --name scootrregistry
- Sign in to the registry
docker login scootrregistry.azurecr.io --username scootrregistry
- Build the local image
docker build . -t sp:latest
- Tag the local image for the registry
docker tag sp scootrregistry.azurecr.io/sp:latest
- Push Service Provider image to the registry
docker push scootrregistry.azurecr.io/sp:latest
- Create an App Service plan
az appservice plan create --name scootr-asp --resource-group scootr --sku B1 --is-linux
- Create Web App
az webapp create --resource-group scootr --plan scootr-asp --name scootr --deployment-container-image-name scootrregistry.azurecr.io/sp:latest
- Add custom domain
az webapp config hostname add --hostname spid.scootr.it --resource-group scootr --webapp-name scootr
- Create a managed certificate for the custom domain
az webapp config ssl create --resource-group scootr --name scootr --hostname spid.scootr.it
- Bind the SSL certificate to the web app
az webapp config ssl bind --certificate-thumbprint {certificate-thumbprint} --name scootr --resource-group scootr --ssl-type SNI
- Set HTTPS Only mode
az webapp update --https-only true --name scootr --resource-group scootr
- Add environment settings to the web app
az webapp config appsettings set -g scootr -n scootr --settings ENV="prod"
az webapp config appsettings set -g scootr -n scootr --settings SP_ENTITYID="https://spid.scootr.it"
az webapp config appsettings set -g scootr -n scootr --settings DATABASE_CONNECTION_STRING="host={DB_HOST} port={DB_PORT} dbname={DB_NAME} user={DB_USER} password={DB_PASS}"
az webapp config appsettings set -g scootr -n scootr --settings STRIPE_SECRET_API_KEY="{STRIPE_SECRET_API_KEY}"
az webapp config appsettings set -g scootr -n scootr --settings CLIENT_HOST="https://scootr.it"
Please DO NOT ever do this.
This is just for testing and learning purposes.
I'm also assuming you already followed the previous steps.
- Build the local image
docker build . -f Dockerfile.idp.prod -t testidp:latest
- Tag the local image for the registry
docker tag testidp scootrregistry.azurecr.io/testidp:latest
- Push Test Identity Provider image to the registry
docker push scootrregistry.azurecr.io/testidp:latest
- Create Web App
az webapp create --resource-group scootr --plan scootr-asp --name spidtestidp --deployment-container-image-name scootrregistry.azurecr.io/testidp:latest
- Add custom domain
az webapp config hostname add --hostname testidp.scootr.it --resource-group scootr --webapp-name spidtestidp
- Create a managed certificate for the custom domain
az webapp config ssl create --resource-group scootr --name spidtestidp --hostname testidp.scootr.it
- Bind the SSL certificate to the web app
az webapp config ssl bind --certificate-thumbprint {certificate-thumbprint} --name spidtestidp --resource-group scootr --ssl-type SNI
- Set HTTPS Only mode
az webapp update --https-only true --name spidtestidp --resource-group scootr