Create an Azure Website in Azure Portal. In this example, I am going to create an azure website with name “cloud-demo-providerapps”
I wish to use one azure website to host multiple provider hosted apps. So I am going to create separate folders to deploy my provider hosted app files as shown below: (In this example, I am going to deploy my provider hosted app files under “AzureDeployTest” folder.)
Note: It is mandatory to check the application checkbox
To prepare the build, create a new folder in your system(laptop/server). In this example the folder name is “SPOL_Stage_Build_09252015V01”
Download the azure website profile from azure portal and paste it inside the “SPOL_Stage_Build_09252015V01” folder. In this example my azure profile name is “cloud-demo-providerapps.azurewebsites.net.PublishSettings”
Note: This will be done by admin team. So include this in the deployment instruction.
- Create a XML file inside the “SPOL_Stage_Build_09252015V01” folder with name “xml” and configure the XML file in the below format
<?xml version=”1.0″ encoding=”utf-8″?>
Here cloud-demo-providerapps is the azure website name and AzureDeployTest is the folder where I wanted to place my provider app files.
- Download the below PowerShell script from my one drive and paste it inside the “SPOL_Stage_Build_09252015V01” folder
- Package the provider hosted web project and paste the zip file inside the “SPOL_Stage_Build_09252015V01” folder. In this example my package file name is “AzureDeployTestWeb.zip”
Note: This will be done by development team.
- At this point my build should be ready as shown below
- Open the Windows PowerShell IDE and navigate to the “SPOL_Stage_Build_09252015V01” folder location
- Execute the following command
.\Publish-AzureWebApp.ps1 -WebDeployFile AzureDeployTestWeb.zip –SetParametersFile config.xml -PublishSettingsFile cloud-demo-providerapps.azurewebsites.net.PublishSettings
- If everything works fine, deployment artifacts should be deployed to the target folder and you should see the success message in the powershell IDE.