Deploying Orders & Products API to Azure Function
Deploying Orders API to Azure Function
Right click on the PetShop.Orders.API project and click publish. And click on the publish by selecting “Create New” radio button
When you click publish it will ask to create new App Service, enter details as below.Give a unique App Name for orders azure function
Click on Create for the orders azure functions
Once done copy the url(highlighted in red of below image) from the publish page.
Open the environment.prod.ts of PetShopUI and paste the url in orderServiceUrl
Login to azure portal search for orders azure function.
Click on CORS and add the PetshopUI url to the Allowed Orgins as below.
To Update your connection string,navigate to “Application Settings” as below.Click “Application Settings”.
Scroll down to Connection String and update the connection string name and value as below
Deploying Products API to Azure Function
Right click on the PetShop.Products.API project and click publish. And click on the publish by selecting “Create New”
When you click publish it will ask to create new App Service, enter details as below. Give a unique App Name for products azure function.
Once done copy the url (highlighted in red of below image) from the publish page..
Login to azure portal search for Products azure function.
Click on CORS and add the PetshopUI url to the Allowed Orgins as below.
To Update your connection string,navigate to “Application Settings” as below.Click “Application Settings”.
Scroll down to Connection String and update the connection string name and value as below
Deploying Angular App after updating details
Open the environment.prod.ts of PetShopUI and paste the url in productServiceUrl
Save your work.
Run
“ng build --prod”
Right click on the app and click Deploy to Web App.
Select the dist /PetshopUI by clicking on the Browse.
Click Deploy on the popup and test the app.