What is the process of deploying Angular Server Side Rendering (SSR) build files to Azure Web App service using FileZilla FTP?

I'm currently working on Angular SSR and utilizing the Angular official sample project for testing purposes.

Steps for building the Angular SSR project:

  1. Execute npm run build:ssr
  2. This will automatically generate the dist folder, which contains both the browser and server folders.
  3. Connect to the Web App Service FTP using FileZilla.
  4. Upload the build files to wwwroot.

I have experimented with various deployment methods:

  • Attempted deploying the browser and server folders to the Azure wwwroot folder, but encountered issues where opening the URL displayed "You do not have permission to view this directory or page."
  • Tried deploying the content within the browser folder. This approach worked partially, however, navigating directly to 'www.something.com/dashboard' resulted in an error stating "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." Unsure if this is the correct method.
  • Deployed the content within the server folder, resulting in "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

My Questions:

  • What is the correct way to deploy Angular SSR to Azure Web App service?

It would be greatly appreciated if someone could outline all the steps from building to deploying on Azure Web App service. Any screenshots or URLs for reference would also be helpful.

Answer №1

To deploy your Angular:SSR application to Azure App Service using Filezilla FTP, follow these steps:

  • Upload the contents of the dist/browser folder, which includes the index.html file, to the site/wwwroot directory.
  • Verify that all files have been properly deployed and are accessible in the site/wwwroot directory.

  • In the Configuration settings of your App Service, add index.html as a default document.

Enable Application logging in your Web app's App Service Logs to easily track down any errors in the logs available in LogStream.

Another method to deploy an Angular Server-Side Rendering application to Azure is by using Azure DevOps:

Start by pushing your code to GitHub:

  1. Create a new repository on GitHub and push your application code to it.
  • In your command prompt, navigate to the root folder of your project and execute the following commands:
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin <your_repository_url>
git push -u origin main 

For a sample YAML code demonstrating how to deploy an Angular SSR universal application to Azure web app service via a DevOps pipeline, refer to SiddheshDesai's solution on Stack Overflow here: Sample yaml code link.

[YAML code example goes here]

You can also check out the instructions shared on Stack Overflow on how to deploy an Angular 5 build:ssr on Azure by both r3plica and starian-chen-msft: Stack Overflow guide link.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing Observable Data in Angular 4 TypeScript Components

Looking to extract and assign a JSON value obtained from an API into a variable. Here is an example: TS this.graphicService.getDatas().subscribe(datas => { this.datas = datas; console.log(datas); }); test = this.datas[0].subdimensions[0].entr ...

The functionality to disable the ES lint max length rule is malfunctioning

In trying to disable an eslint rule in a TypeScript file, I encountered an issue with a regular expression that exceeded 500 characters. As a result, an eslint warning was generated. To address this, I attempted to add an eslint comment before declaring th ...

Using Angular 12 to seamlessly import JSON files into TypeScript

My project contains a JSON file located at src/assets/version.json with the following content: {"VERSION":"1.0.0"} I have imported this file into a TypeScript file (e.g., *.ts) as shown below: import * as VersionInfo from 'src/ass ...

Navigating the enum data model alongside other data model types in Typescript: Tips and Tricks

In my different data models, I have utilized enum types. Is it possible to compare the __typename in this scenario? enum ActivtiyCardType { Dance, ReferralTransaction, } type ActivityCardData = { __typename:ActivtiyCardType, i ...

Unable to bring in the specified export 'Directive' from a non-EcmaScript module - only the default export is accessible

I am currently working on an ionic angular project and utilizing the ng-lazyload-image plugin. However, I am encountering errors during compilation that look like this: Error: ./node_modules/ng-lazyload-image/fesm2015/ng-lazyload-image.mjs 401:10-19 Can ...

Tips for implementing Peer.js in Next.js using TypeScript?

Next.js has the ability to run on the server side, which can result in Peer.js throwing errors when used with Next.js. One user on Stack Overflow explains this issue: The error is likely due to peer js performing side effects during import. The suggest ...

Exporting from Excel is causing dates and times to be displayed as numbers instead

Having trouble with a specific date while exporting an Excel file. Refer to the screenshot of the Excel file for clarity: https://i.stack.imgur.com/7mFE4.png The date '01/02/2019 00:00:00' is being treated as a number instead of displaying corre ...

Issue with upgrading node from 12v to 16v: Trying to access a property that does not exist, specifically 'splice', within a circular dependency in module exports

After upgrading the node version from 12 to 16, we encountered a debugging console error. The 'Promises' are failing to resolve following this error, leading to the termination of further execution. (node:28112) Warning: Accessing non-existent p ...

Error message in Angular 2 RC-4: "Type 'FormGroup' is not compatible with type 'typeof FormGroup'"

I'm currently facing an issue with Angular 2 forms. I have successfully implemented a few forms in my project, but when trying to add this one, I encounter an error from my Angular CLI: Type 'FormGroup' is not assignable to type 'typeo ...

Jest: A runtime error occurred because the property being accessed is undefined

Currently, I am testing my React class which includes the import statement import dotnetify from "dotnetify";. While this works without any issues, Jest is reporting that dotnetify is undefined. Interestingly, when I switch the import to const do ...

Why isn't my Next.js middleware working properly with TypeScript?

My issue arises from the fact that, despite following the documentation, the middleware in Next.js is not functioning as I anticipated. I experimented with what I thought was the simplest middleware possible. I expected that when navigating to /, a conso ...

Display and conceal table columns dynamically in Vue by utilizing the Vuetify data table functionality

Looking for an example: How to show hide columns of vuetify data table using v-select list I have created something similar, but I'm facing an issue where the table doesn't refresh when changing the header data: https://codepen.io/Meff1/pen/vY ...

What is the process for obtaining the result and storing it in an array using M

Recently, I just started exploring angular and ventured into using mongoose with mongodb. Within my application, I require a list of driver names in the form of a string array. However, instead of receiving a simple array of names, I am getting an array o ...

A guide on implementing a "Select All" trigger in mat-select with Angular8/Material

Here is the code I have created: <mat-form-field appearance="outline"> <mat-label>Handler Type</mat-label> <mat-select multiple [(value)]="handlerType"> <mat-option *ngFor="let handler of handlerT ...

How can you initialize Boostrap components or Materialize css in Angular 5 without using any external libraries?

I am a beginner exploring the world of Typescript and Angular. I am curious about how to initialize Bootstrap elements in an Angular-friendly manner without using the ngx-Bootstrap wrapper. For instance, if I wish to initiate a Bootstrap carousel. As per ...

Unable to utilize the Object.values method with an object in TypeScript

I am attempting to create an array of values from all the keys within an object by using the Object.values(obj) function, but I encountered the following error message: No overload matches this call. Overload 1 of 2, '(o: { [s: string]: string; } | ...

How can I prevent right-clicking with Ctrl+LeftMouseClick in Firefox on MacOS?

I'm looking to implement a shortcut using Ctrl+LeftMouseClick in my React project. It functions perfectly on Chrome on my Mac, but in Firefox the shortcut initiates a right mouse click (event.button = 2). I believe this may be due to MacOS's Rig ...

Can you explain the functionality of this Observable in the context of this Angular 2 example?

I'm not too familiar with JavaScript/TypeScript and I have a question about how this code snippet works: onGet() { this.serverService.getServers() .subscribe( (servers: any[]) => this.servers = servers, // an array of anythin ...

The rendering of ReactJS context-api is not working as expected after receiving the data

This is a unique site built on next.js. To ensure both my Navbar component and cart page have access to the cart's content, I created a context for them. However, when trying to render the page, I encounter the following error: Unhandled Runtime Erro ...

Pull in a component from another repository

I recently established a repository in bitbucket named "angular-lister". The layout of the repository can be viewed https://i.sstatic.net/bDANV.png. Subsequently, I created another repository with a similar structure, although I cannot display an image he ...