Bitbucket Pipeline scripts to deploy Angular applications to Microsoft Azure Webapps. For both, server side (with Node) and client side (with Apache) rendering versions.
- Get a Microsoft Azure Subscription.
- Create a Webapp (for the example, also create a "develop" slot in the webapp).
- If you are using server side rendering (SSR), select a NodeJS runtime stack (mind that Azure will run the start script in your package.json on webapp start). If you are not using SSR, but rather client side rendering (CSR), I would recommend to go for the PHP7 stack, which will enable Apache as web server.
- For the SSR version, you should define the Node server setup within your Angular app. For the CSR version, you should add an .htaccess file to your Angular app (check https://github.com/jekuer/angular-ideal-htaccess).
- Open Azure PowerShell and run "az ad sp create-for-rbac --name bitbucket-deployment-principal".
- Note the values the call returns.
- Go to your Bitbucket repository, go for "settings" and hit "Repository variables" within the pipelines section.
- Create the following variables and use the previously gained values:
- AZURE_APP_ID
- AZURE_PASSWORD (make this one private)
- AZURE_TENANT_ID
- Copy the bitbucket-pipelines.yml to your Angular project root.
- Adjust the file.
- Push and see the magic happening!