I use Bitbucket for its private repos and recently decided to deploy my app to Azure. I was determined to do it with a pipeline, but it took some research to finally get it to work. If you want to follow the same path, here is what you have to do.
A React app — I created one using
npx create-react-app <APP-NAME>.
We will be deploying the app to an Azure App Service. Create one by going to the Azure Portal, click on Create a resource and choose Web App.
Your Web App needs to use Keycloak to authenticate its users or simply to acquire an access token? Here is how you can configure Keycloak to accept its requests.
Firstly, let’s create a new realm. If you already have a realm you want to use you can skip this section.
In your Keycloak’s Admin Console look for the drop-down in the upper left corner and click on Add Realm:
The backend API expects a Keycloak access token and the UI must allow the user to authenticate herself and then send the access token with every request. If this sounds like your JIRA ticket, then stick around.
A Keycloak server instance. I am using the Docker image (v11.0.2) running on
http://localhost:8080. For a walkthrough on setting up Keycloak, check out my article on How to configure Keycloak for a Web App.
Let’s start by creating a simple Gatsby application. The easiest way would be to clone the Gatsby starter git repo https://github.com/gatsbyjs/gatsby-starter-hello-world.
To handle the communication with the Keycloak server…
Run C.M.D. - IT‘s Tricky