Moving my portfolio from GitHub to Azure DevOps
I set up my portfolio on Azure Static Web Apps in 2024. When I decided to move the project to Azure DevOps, I had to retrace how the site was published. That turned the migration into two smaller jobs: move the source code, then replace the pipeline that publishes it. I imported the repository and successfully deployed the portfolio from Azure Pipelines. The live homepage and its main stylesheet returned HTTP 200 after the deployment. I then disabled the old GitHub Actions workflow.
Tracing the original setup
I found the original provisioning record under Resource groups → portfolio-website → Deployments. Its details showed that the Azure Portal deployment created a Static Web App named my-portfolio-website. On the app’s Overview, the source was listed as main (GitHub) and the production site was rowelmanog.com.
The deployment record told me when the hosting resource was created. The generated workflow under .github/workflows/ explained how later changes were published. A push to main triggered GitHub Actions, which checked out the repository and uploaded the static files using a deployment token. The workflow also managed separate preview deployments for pull requests.
Once I could see those pieces, the migration was easier to plan. Azure Repos could hold the code, Azure Pipelines could publish it, and the existing Static Web App could keep serving the same domain.
Importing the private GitHub repository
- In GitHub, I opened the repository and copied its HTTPS clone URL from Code.
- In my Azure DevOps project, I opened Repos → Files, expanded the repository picker, and selected Import repository.
- I pasted the clone URL and enabled Requires authentication. The import form takes a GitHub username and a GitHub personal access token in the password field.
- My old token was rejected. For this one-time import, a short-lived, fine-grained GitHub token scoped to the portfolio repository with Contents → Read-only is enough to read the source.
- Azure DevOps showed Import Successful. I opened Repos → Files → History on
mainand matched the latest commit,2739aee1, to the GitHub source. The Azure Repos view also showed earlier commits and the site'sindex.html,assets/, andimages/. Once the copy is verified, the import token can be revoked. Azure Repos import guide · GitHub token guide
The import creates a copy of the Git repository, including its commit history. Issues, pull request conversations, secrets, and branch policies are managed separately. The production deployment still points to the old workflow at this stage.
Deploying from Azure Pipelines
I committed azure-pipelines.yml to the imported repository’s main branch as 22c91b34. In Azure Pipelines, I selected the existing YAML file and added the Static Web App’s deployment token as the secret variable SWA_DEPLOYMENT_TOKEN. The GitHub token used for the import serves a separate purpose. Static Web Apps deployment task
I manually started run #20261128.1 from main. It staged index.html, assets/, and images/ and successfully deployed them to the existing Static Web App. The full job took 44 seconds, including 40 seconds for the deployment step.
Completing the cutover
After the run, I checked the existing domain. Both the portfolio homepage and its main stylesheet returned HTTP 200. I then disabled the old workflow from the GitHub Actions tab. GitHub showed that it was disabled manually and kept the workflow file available. Azure Repos now holds the source code, and Azure Pipelines deploys changes from main to the same Static Web App and custom domain.
Requiring validation before merge
I set main as the default branch and added the portfolio pipeline under Branch policies → Build validation. I set the trigger to Automatic and the policy to Required, so pull requests targeting main must pass the pipeline before they can merge. Azure Repos branch policies
I opened PR #1 with a small README update. The branch policy automatically queued run #20261128.2. The staging step passed, and the job skipped Deploy to Azure Static Web Apps.
After I merged the PR, Azure Pipelines automatically queued run #20261128.3 for commit dac0fb76 on main. The run was labeled Batched CI, and Deploy to Azure Static Web Apps passed. The job took 46 seconds, including 40 seconds for deployment. That verified the full workflow: the PR ran validation, and the merge triggered the production deployment.