The Problem:
Unable to deploy Angular Server Side Rendering (SSR) build files to Azure Web App service using FileZilla. Tried various approaches, including deploying browser and server folders, content within browser and server folders, but facing errors such as ‘permission denied’ or ‘resource unavailable’. Need guidance on the correct deployment procedure for Angular SSR to Azure Web App service.
The Solutions:
Solution 1: Deploy via FileZilla FTP
To deploy your Angular SSR application to Azure App Service using FileZilla FTP:
- Build your application using
npm run build:ssr
to generate thedist
folder. - Connect to your Web App Service FTP using FileZilla and navigate to the
wwwroot
folder. - Upload the contents of the
dist/browser
folder (including theindex.html
file) to thewwwroot
folder. - In the Azure App Service configuration, under Default Documents, add
index.html
as the default page. - Enable Application logging to capture any errors in the log stream.
Solution 2: Deploy via Azure Devops
Alternatively, you can deploy using Azure Devops:
- Create a GitHub repository and push your code to it.
- Use a YAML script to automate the build and deployment process, similar to the example provided.
- Create a build pipeline in Azure Devops and trigger it when changes are made to your GitHub repository.