Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
When you use developer tools, you store the Power Pages site in a Git repository that you manage. You download the site with Power Platform CLI, commit the files, and review changes through pull requests before CI/CD deploys them.
Use this approach for standard data model sites, which can't use Git integration. You can also use it for enhanced data model and SPA code sites when you can't use Git integration. If you can, Git integration is the recommended starting point for those sites. For details, see Use Git integration with Power Pages.
Prerequisites
- Power Platform CLI, installed and authenticated to the development environment. For steps, see Tutorial: Use Microsoft Power Platform CLI with Power Pages.
- A Git repository in Azure DevOps, GitHub, or another Git provider, with permission to create branches and pull requests.
- The site ID and data model of the site. Run
pac pages list -vto list the sites in the environment and show whether each one uses the standard or enhanced data model.
Download the site into your repository
Download the site from the development environment into a folder in your local clone of the repository.
Standard data model sites: Use
pac pages downloadwith--modelVersion 1.pac pages download --path "C:\repos\contoso-site" --webSiteId <website-id> --modelVersion 1Enhanced data model sites: Use
pac pages download --modelVersion 2.pac pages download --path "C:\repos\contoso-site" --webSiteId <website-id> --modelVersion 2SPA code sites: Use
pac pages download-code-site, or commit the SPA project that you upload withpac pages upload-code-site. For the SPA workflow, see CI/CD for single-page applications with developer tools.
Use --overwrite when you download into a folder that already contains site content. For all parameters, see Microsoft Power Platform CLI support for Power Pages.
Promote enhanced data model and SPA code sites with solutions, even when you store their files in a repository that you manage. For details, see Overview of ALM with developer tools.
Configure .gitignore
When you run pac pages download, it generates two manifest files along with the site content. Treat these files differently in source control:
org-url-manifest.yml: The environment manifest file tracks changes since the last download from one specific environment. This tracking helps ensure that uploads to the same environment include only changed content. This file isn't designed to track changes across environments. Add it to.gitignore.manifest.yml: The delete tracking manifest file tracks records that you delete from the environment. Power Platform CLI uses it regardless of which environment you're connected to, so an upload can delete the same records in a different environment. Keep it in source control.
Also, exclude files that contain secrets. For SPA code sites, don't commit build output or node_modules.
A .gitignore entry for the environment manifest file might look like this:
# Environment-specific Power Platform CLI manifest
*-manifest.yml
!manifest.yml
Suggested repository structure
The following structure is a recommendation. Adapt it to your team's conventions.
<repository>/
├── site/ # Output of pac pages download
│ ├── deployment-profiles/ # Deployment profiles for each target environment
│ │ ├── test.deployment.yml
│ │ └── prod.deployment.yml
│ ├── manifest.yml # Delete tracking manifest, kept in source control
│ └── <site content folders>
├── pipelines/ # Azure Pipelines or GitHub workflow definitions
└── .gitignore
For more information about deployment profiles, see Manage environment-specific values in Power Pages ALM.
Branching strategy
Branches serve the developer inner loop. Deploy to downstream environments through CI/CD, not by merging branches that environments sync with.
- Main branch: Holds the reviewed state of the site. CI/CD builds release artifacts from this branch.
- Feature branches: Each developer works in a feature branch, uploads changes to their own development environment, and downloads the result to commit.
- Pull requests: Merge feature branches into the main branch through pull requests so that changes are reviewed before they're released.
- Hotfix branches: Create a hotfix branch from the tag of the release that's in production. For details, see Roll back and hotfix Power Pages releases.
Before you start new work, pull the latest main branch into your feature branch, and upload it to your development environment so that the environment and the branch match.
Understand delta and full uploads
pac pages upload uses the environment manifest file to decide what to upload:
- Delta upload: When you download from and upload to the same environment, Power Platform CLI detects local changes and uploads only the updated files.
- Full upload: When you download from one environment and upload to another, Power Platform CLI uploads all content. The manifest files don't carry state across environments.
Use --forceUploadAll to push all local files when you suspect a delta upload failed, for example when only part of your changes appear, or when the last server state no longer matches your branch because you rebased or cherry-picked commits. This parameter is available only in Power Platform CLI. Azure DevOps tasks don't surface it.
Delete records across environments
To delete site records in one environment and delete the same records in another environment:
- Run
pac pages downloadbefore you delete the records. - Delete the records in the development environment.
- Run
pac pages downloadagain. The delete tracking manifest file,manifest.yml, records the deletions. - Commit
manifest.ymlwith the rest of your changes. - Run
pac pages uploadagainst the target environment. The upload removes the corresponding records.