In this tutorial, you'll deploy the demo Adyen account and learn how to:
[!div class="checklist"]
- Set up an Adyen account, the required PowerShell and
az cli
tools, an Azure subscription, and a service principal on Azure.- Deploy the Azure resources using either Azure portal or PowerShell.
- Make your deployment visible to consumers by publishing the Azure developer portal.
To prepare for this demo, you'll need to:
[!div class="checklist"]
- Create an Adyen test account.
- Install and set up the required PowerShell and Azure CLI tools.
- Set up an Azure subscription.
- Set up a service principal in Azure.
From within an Adyen test account:
- Expand the Accounts tab on the pages panel on the left side of the Adyen test account homepage, select the Merchant accounts option.
- If you do not have one already, create a merchant account for an ecommerce sales channel.
Three values should be copied from the Adyen test account that are required as input parameters during the deployment process:
- Copy the Merchant account name which is the displayed in the top left corner of the Adyen test account homepage.
- Expand the Developers tab on the pages panel on the left side of the Adyen test account homepage, select the API Credentials option.
- Select the ws (Web Service) API.
- Generate and copy an API key and copy the Client key.
After the deployment of the Azure resources (see below) has completed, you should return to the Adyen test account homepage to:
- Expand the Developers tab on the pages panel on the left side of the Adyen test account homepage, select the API Credentials option.
- Select the ws (Web Service) API.
- Add a new origin to the list of allowed origins which is the URL of the App Service that has been deployed.
- Version 7.1 or later of PowerShell.
- Version 2.21.0 or later of Azure CLI.
For this sample project, you will need admin access in order to deploy all the included artifacts to Azure. If you do not have an Azure subscription, set up a free trial.
For the solution to work, the Web App component needs a privileged credential on your Azure subscription with the scope to execute read
operations on API Management (get products, subscriptions, etc.).
Before deploying the resources, set up the service principal in the Azure Active Directory (AAD) tenant used by the Web App to update the status of API Management subscriptions.
The simplest method is using the Azure CLI.
-
az login
-
Create an Azure service principal with the Azure CLI:
az ad sp create-for-rbac --name <chosen-name-for-your-service-principal> --skip-assignment
-
Take note of the
name
(ID),appId
(client ID) andpassword
(client secret), as you will need to pass these values as deployment parameters. -
Retrieve the object ID of your new service principal for deployment:
az ad sp show --id "<id-of-your-service-principal>"
The correct role assignments for the service principal will be assigned as part of the deployment.
You can deploy the monetization resource via either Azure portal or PowerShell script.
Note
For both options, when filling in parameters, leave the stripe*
parameters blank.
Click the button below to deploy the example to Azure and fill in the required parameters in the Azure portal.
You can deploy by running the deploy.ps1
PowerShell script at the root of the repo.
-
Provide a parameters file for the
main.json
ARM template.- Find a template for the parameters file provider in
output/main.parameters.template.json
. - Rename this JSON file to
output/main.parameters.json
and update the values as necessary.
- Find a template for the parameters file provider in
-
Execute the
deploy.ps1
script:deploy.ps1 ` -TenantId "<azure-ad-tenant-id>" ` -SubscriptionId "<azure-subscription-id>" ` -ResourceGroupName "apimmonetization" ` -ResourceGroupLocation "uksouth" ` -ArtifactStorageAccountName "<name-of-artifact-storage-account>"
This example project uses the hosted API Management developer portal.
You are required to complete a manual step to publish and make the resources visible to customers. See the Publish the portal for instructions.
- Learn more about deploying API Management monetization with Adyen.
- Learn about the Stripe deployment option.