Deploy your Angular app to Azure with Hexa.run
MIT License
Inside your Angular project make sure to install the Hexa.run CLI as a prod dependency npm i -S @manekinekko/hexa
as you can see from the package.json of this project.
The npm run heax:...
commands mentioned below are just aliases to the Hexa cli ( see the package.json example file ). You will have to add them to your own package.json
or use your own aliases.
npm i -S @manekinekko/hexa
npm run hexa:login
npm run hexa:init
.
./dist/angular-app-name/
hexa.json
(you need to version it to git).npm run hexa:ci
, and write down the following credentials (you will need them later):{
appId: 'xx4362xx-aaxx-40xx-8bxx-xx6ea0c351xx',
displayName: 'appname',
name: 'http://appname',
password: 'xxce72xx-1axx-44xx-81xx-35xxb15xxa1e',
tenant: 'xxf988xx-86xx-41xx-91xx-2d7cd011dbxx'
}
AZURE_SERVICE_PRINCIPAL_ID
: the appId from the service principal config.AZURE_SERVICE_PRINCIPAL_PASSWORD
: the password from the service principal config.AZURE_SERVICE_PRINCIPAL_TENANT
: The tenant from the service principal config.npm run hexa:login
(this will login to Azure using your secrets)npm run build -- --prod
this will build your Angular app in production mode.npm run hexa:deploy
this will initiate the deploy process to your Azure storage and prints out the URL to your application, which looks like ➜ Hosting: https://xxxx.yy.web.core.windows.net
When it comes to hosting your static application on Azure, Hexa.run will automatically:
static-website
readyHexa can also deploy your Azure Functions, Table Storage or Cosmos DB, etc. (read me).
Don't have an Azure account? Create one for free and get started with 12 months of free services.