| page_title | powerplatform_environment_git_integration Resource - Power Platform |
|---|---|
| subcategory | |
| description | Manages the environment-level Dataverse Git repository binding. This maps to the documented sourcecontrolconfiguration Dataverse table and stores the repository connection metadata for an environment. |
Manages the environment-level Dataverse Git repository binding. This maps to the documented sourcecontrolconfiguration Dataverse table and stores the repository connection metadata for an environment.
terraform {
required_providers {
powerplatform = {
source = "microsoft/power-platform"
}
}
}
provider "powerplatform" {
use_cli = true
}
# Use `scope = "Environment"` to mirror the maker UI environment-level binding.
# In this mode the provider manages the root Dataverse binding and proactively
# enables eligible visible unmanaged solutions in the environment. Built-in
# platform solutions are excluded automatically.
resource "powerplatform_environment" "example" {
display_name = var.environment_display_name
description = "Example environment for validating Dataverse Git integration."
location = var.location
azure_region = var.azure_region
environment_type = "Sandbox"
dataverse = {
language_code = "1033"
currency_code = "USD"
security_group_id = var.security_group_id
}
}
resource "powerplatform_environment_git_integration" "example" {
environment_id = powerplatform_environment.example.id
git_provider = var.git_provider
scope = var.scope
organization_name = var.organization_name
project_name = var.project_name
repository_name = var.repository_name
}environment_id(String) Environment ID of the Dataverse environment where the Git repository binding will be created.git_provider(String) Git provider for the repository binding. Supported value isAzureDevOps.organization_name(String) Organization or owner name for the configured Git provider.project_name(String) Project name for the Azure DevOps repository binding.repository_name(String) Repository name that the environment will bind to.scope(String) Source control integration scope for the environment. UseSolutionfor solution-level branch bindings andEnvironmentfor an environment-level binding. InEnvironmentscope, the provider manages the root branch binding and proactively enables eligible visible unmanaged solutions in the environment while excluding platform-owned default solutions.
timeouts(Attributes) (see below for nested schema)
id(String) Unique identifier of the Dataverse source control configuration.
Optional:
create(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).delete(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.read(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.update(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
Import is supported using the following syntax:
The terraform import command can be used, for example:
# Environment Git integration resources can be imported using the environment id (replace with a real environment id)
terraform import powerplatform_environment_git_integration.example 00000000-0000-0000-0000-000000000000