Setting up environment variables
Finally, we create environment variables with subscription ID, tenant, name, and password. We need to export this on the Jenkins node and set up a deployment. So let's do that:
- Open the Jenkins in browser and add a new job with a click on New Item. Enter the item name myAzureFunctionDeploy and select Freestyle project, and click OK.
- On the job configuration page, tick This project is parameterised and add Password Parameter below the name and default values retrieved from the Azure commands as follows:
azureServicePrincipalTenantId azureServicePrincipalClientId azureServicePrincipalPassword azureSubId
- Let's click on the Source Code Management tab and add the repository URL as https://github.com/shzshi/azure-helloworld-ci.git, the repository has the required files.
- In Build Environment select Inject passwords to the build as environmentvariables. We are doing this to mask the Azure credentials and other details.
- Next, click on the Build tab and, in the execute...