Publishing to production

Let's carry out the following steps to publish our frontend to a production environment:

  1. We'll start by provisioning an Azure App Service. So, let's go to the Azure portal in a browser and go to the App Services area and click the Add option.
  2. Complete the form that opens by choosing the existing resource group, choosing an app name, and selecting .NET Core 3.0 as the runtime stack and Windows as the operating system. Note that the app name we choose needs to be reflected in the Frontend setting in the appsettings.Production.json file in our backend project. Click the Review + create button and then the Create button to create the app service. 
  3. Let's move to Visual Studio Code now and create a production build by running the following command in the Terminal:
> npm run build:production

After the build has finished, the production build will consist of all of the files in the build folder.

  1. We are going to use the Azure App Service extension to perform the Azure deployment. So, let's install this:

  1. Click the Azure icon in the left-hand navigation options and then the Sign in to Azure... option:

  1. We are prompted to enter our Microsoft account credentials, so let's enter these.
  1. We should see the frontend app service listed in the tree. Right-click on this and choose the Deploy to Web App... option:

  1. We should select our build folder when prompted for the folder to deploy.
  1. We are then asked to confirm the deployment, which we do by clicking the Deploy button:

  1. Deployment will take a minute or so before we get confirmation that it is complete:

  1. If we click on the Browse Website option, our frontend in Azure will display in a browser:

Our frontend is now deployed nicely to the production environment. We won't be able to sign in successfully yet—we'll resolve this after we have published our frontend to the staging environment.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.161.79