
Prerequisites:
- An Azure account with following services:
- An instance of Azure Container Registry.
- An instance of Azure Database for MySQL with an empty database.
- An instances of Azure WebApp for Containers.
- An Azure DevOps account for performing CI/CD.
Code Structure:
You can find the Sample Code here, create a new project in Azure DevOps and import the code there.
- HTML Directory: contains the WordPress structured files and directories like wp-config.php, wp-content, etc.
- Dockerfile: contains the commands for building the containerized image:
FROM wordpress:4.9.1-apache
COPY html /var/www/html
RUN chown -R www-data:www-data /var/www/html/
ENTRYPOINT ["apache2-foreground"]
Building Project Pipeline:
- Continuous Integration:
-
- Create a new project in Azure DevOps
- In the Repos section, select Import to import the repository from Github
- Now ,in the Pipelines section, create a new pipeline and select your repository that has the code
- Search and select the Docker Container job to build and push the image to Azure Container Registry
- Select the Azure Pool and Agent Specification according to the requirement, and in the two tasks add the information accordingly
- In the Triggers, enable Continuous Integration and Save & Queue the pipeline
-
- In Azure DevOps, go to the Pipeline section and select Release and create a New Pipeline
- Select Azure App Service Deployment as the CD job
- Select the Artifact source as Azure Container Registry and select the registry and repository
- Select the Agent Pool and Agent Specifications according to requirements and configure the remaining task accordingly
- Enable Continuous Deployment trigger, save the pipeline and select Create Release to run it
- After completion of the Release pipeline, we can view the logs details of steps involved in the pipeline
Installing WordPress:
- Go to the app service in Azure Portal which has wordpress deployed in it and click on Browse

- Now we can install WordPress

Ready to get started?
As a Microsoft partner with expertise in application migration and modernization, we’re ready to help you move your apps to the cloud.