Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/unreleased/added-20260330-193000.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: added
body: Add powerplatform_publisher resource and data source with Dataverse CRUD support and nested address handling
time: 2026-03-30T19:30:00Z
custom:
Issue: 1133
80 changes: 80 additions & 0 deletions docs/data-sources/publisher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "powerplatform_publisher Data Source - Power Platform"
subcategory: ""
description: |-
Fetches a Dataverse publisher by Dataverse publisher id or unique name.
---

# powerplatform_publisher (Data Source)

Fetches a Dataverse publisher by Dataverse publisher id or unique name.

## Example Usage

```terraform
data "powerplatform_publisher" "example" {
environment_id = "00000000-0000-0000-0000-000000000001"
uniquename = "contoso"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `environment_id` (String) Id of the Dataverse-enabled environment containing the publisher.

### Optional

- `id` (String) Dataverse publisher id.
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
- `uniquename` (String) Unique name of the publisher.

### Read-Only

- `address` (Attributes List) Publisher addresses mapped from Dataverse address slots 1 and 2. (see [below for nested schema](#nestedatt--address))
- `customization_option_value_prefix` (Number) Option value prefix used for option set values created by this publisher.
- `customization_prefix` (String) Customization prefix used for solution components created by this publisher.
- `description` (String) Description of the publisher.
- `email_address` (String) Email address for the publisher.
- `friendly_name` (String) Display name of the publisher.
- `is_read_only` (Boolean) Whether Dataverse reports this publisher as read only.
- `supporting_website_url` (String) Supporting website URL for the publisher.

<a id="nestedatt--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) 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.


<a id="nestedatt--address"></a>
### Nested Schema for `address`

Read-Only:

- `address_id` (String) Dataverse address identifier for the slot.
- `address_type_code` (Number) Address type code.
- `city` (String) City name.
- `country` (String) Country or region name.
- `county` (String) County name.
- `fax` (String) Fax number.
- `latitude` (Number) Latitude value.
- `line1` (String) Street line 1.
- `line2` (String) Street line 2.
- `line3` (String) Street line 3.
- `longitude` (Number) Longitude value.
- `name` (String) Address name.
- `post_office_box` (String) Post office box.
- `postal_code` (String) Postal code.
- `shipping_method_code` (Number) Shipping method code.
- `slot` (Number) Address slot number in Dataverse. Valid values are `1` and `2`.
- `state_or_province` (String) State or province name.
- `telephone1` (String) Primary telephone number.
- `telephone2` (String) Secondary telephone number.
- `telephone3` (String) Tertiary telephone number.
- `ups_zone` (String) UPS zone value.
- `utc_offset` (Number) UTC offset for the address.
124 changes: 124 additions & 0 deletions docs/resources/publisher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "powerplatform_publisher Resource - Power Platform"
subcategory: ""
description: |-
Manages a Dataverse publisher record. Publishers own solution customization prefixes and related metadata.
---

# powerplatform_publisher (Resource)

Manages a Dataverse publisher record. Publishers own solution customization prefixes and related metadata.

## Example Usage

```terraform
resource "powerplatform_publisher" "example" {
environment_id = "00000000-0000-0000-0000-000000000001"
uniquename = "contoso"
friendly_name = "Contoso Publisher"
customization_prefix = "cts"
description = "Terraform-managed Dataverse publisher"
email_address = "publisher@contoso.example"
supporting_website_url = "https://contoso.example"

address = [
{
slot = 1
line1 = "1 Collins Street"
city = "Melbourne"
country = "Australia"
postal_code = "3000"
telephone1 = "+61-3-5555-0101"
},
{
slot = 2
line1 = "100 Queen Street"
city = "Auckland"
country = "New Zealand"
postal_code = "1010"
telephone1 = "+64-9-555-0102"
}
]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `customization_prefix` (String) Customization prefix used for solution components created by this publisher.
- `environment_id` (String) Id of the Dataverse-enabled environment containing the publisher.
- `friendly_name` (String) Display name of the publisher.
- `uniquename` (String) Unique name of the publisher.

### Optional

- `address` (Attributes List) Up to two publisher addresses, mapped to Dataverse address slots 1 and 2. (see [below for nested schema](#nestedatt--address))
- `customization_option_value_prefix` (Number) Option value prefix used for option set values created by this publisher. When omitted, the provider derives the same default value generated by the Power Apps publisher UI from `customization_prefix`.
- `description` (String) Description of the publisher.
- `email_address` (String) Email address for the publisher.
- `supporting_website_url` (String) Supporting website URL for the publisher.
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))

### Read-Only

- `id` (String) Dataverse publisher id.
- `is_read_only` (Boolean) Whether Dataverse reports this publisher as read only.

<a id="nestedatt--address"></a>
### Nested Schema for `address`

Required:

- `slot` (Number) Address slot number in Dataverse. Valid values are `1` and `2`.

Optional:

- `address_type_code` (Number) Address type code.
- `city` (String) City name.
- `country` (String) Country or region name.
- `county` (String) County name.
- `fax` (String) Fax number.
- `latitude` (Number) Latitude value.
- `line1` (String) Street line 1.
- `line2` (String) Street line 2.
- `line3` (String) Street line 3.
- `longitude` (Number) Longitude value.
- `name` (String) Address name.
- `post_office_box` (String) Post office box.
- `postal_code` (String) Postal code.
- `shipping_method_code` (Number) Shipping method code.
- `state_or_province` (String) State or province name.
- `telephone1` (String) Primary telephone number.
- `telephone2` (String) Secondary telephone number.
- `telephone3` (String) Tertiary telephone number.
- `ups_zone` (String) UPS zone value.
- `utc_offset` (Number) UTC offset for the address.

Read-Only:

- `address_id` (String) Dataverse address identifier for the slot.


<a id="nestedatt--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) 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](https://pkg.go.dev/time#ParseDuration) 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](https://pkg.go.dev/time#ParseDuration) 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](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# Publisher resource can be imported using the composite id <environment_id>_<publisher_id>
terraform import powerplatform_publisher.example 00000000-0000-0000-0000-000000000001_11111111-1111-1111-1111-111111111111
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "powerplatform_publisher" "example" {
environment_id = "00000000-0000-0000-0000-000000000001"
uniquename = "contoso"
}
3 changes: 3 additions & 0 deletions examples/data-sources/powerplatform_publisher/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "publisher" {
value = data.powerplatform_publisher.example
}
2 changes: 2 additions & 0 deletions examples/resources/powerplatform_publisher/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Publisher resource can be imported using the composite id <environment_id>_<publisher_id>
terraform import powerplatform_publisher.example 00000000-0000-0000-0000-000000000001_11111111-1111-1111-1111-111111111111
3 changes: 3 additions & 0 deletions examples/resources/powerplatform_publisher/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "publisher" {
value = powerplatform_publisher.example
}
28 changes: 28 additions & 0 deletions examples/resources/powerplatform_publisher/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
resource "powerplatform_publisher" "example" {
environment_id = "00000000-0000-0000-0000-000000000001"
uniquename = "contoso"
friendly_name = "Contoso Publisher"
customization_prefix = "cts"
description = "Terraform-managed Dataverse publisher"
email_address = "publisher@contoso.example"
supporting_website_url = "https://contoso.example"

address = [
{
slot = 1
line1 = "1 Collins Street"
city = "Melbourne"
country = "Australia"
postal_code = "3000"
telephone1 = "+61-3-5555-0101"
},
{
slot = 2
line1 = "100 Queen Street"
city = "Auckland"
country = "New Zealand"
postal_code = "1010"
telephone1 = "+64-9-555-0102"
}
]
}
3 changes: 3 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
"github.com/microsoft/terraform-provider-power-platform/internal/services/locations"
"github.com/microsoft/terraform-provider-power-platform/internal/services/managed_environment"
"github.com/microsoft/terraform-provider-power-platform/internal/services/powerapps"
"github.com/microsoft/terraform-provider-power-platform/internal/services/publisher"
"github.com/microsoft/terraform-provider-power-platform/internal/services/rest"
"github.com/microsoft/terraform-provider-power-platform/internal/services/solution"
"github.com/microsoft/terraform-provider-power-platform/internal/services/solution_checker_rules"
Expand Down Expand Up @@ -405,6 +406,7 @@ func (p *PowerPlatformProvider) Resources(ctx context.Context) []func() resource
func() resource.Resource { return licensing.NewBillingPolicyResource() },
func() resource.Resource { return authorization.NewUserResource() },
func() resource.Resource { return data_record.NewDataRecordResource() },
func() resource.Resource { return publisher.NewPublisherResource() },
func() resource.Resource { return environment_settings.NewEnvironmentSettingsResource() },
func() resource.Resource { return connection.NewConnectionResource() },
func() resource.Resource { return rest.NewDataverseWebApiResource() },
Expand Down Expand Up @@ -442,6 +444,7 @@ func (p *PowerPlatformProvider) DataSources(ctx context.Context) []func() dataso
func() datasource.DataSource { return authorization.NewSecurityRolesDataSource() },
func() datasource.DataSource { return application.NewTenantApplicationPackagesDataSource() },
func() datasource.DataSource { return data_record.NewDataRecordDataSource() },
func() datasource.DataSource { return publisher.NewPublisherDataSource() },
func() datasource.DataSource { return rest.NewDataverseWebApiDatasource() },
func() datasource.DataSource { return connection.NewConnectionsDataSource() },
func() datasource.DataSource { return connection.NewConnectionSharesDataSource() },
Expand Down
3 changes: 3 additions & 0 deletions internal/provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/microsoft/terraform-provider-power-platform/internal/services/locations"
"github.com/microsoft/terraform-provider-power-platform/internal/services/managed_environment"
"github.com/microsoft/terraform-provider-power-platform/internal/services/powerapps"
"github.com/microsoft/terraform-provider-power-platform/internal/services/publisher"
"github.com/microsoft/terraform-provider-power-platform/internal/services/rest"
"github.com/microsoft/terraform-provider-power-platform/internal/services/solution"
"github.com/microsoft/terraform-provider-power-platform/internal/services/solution_checker_rules"
Expand Down Expand Up @@ -69,6 +70,7 @@ func TestUnitPowerPlatformProviderHasChildDataSources_Basic(t *testing.T) {
connection.NewConnectionsDataSource(),
connection.NewConnectionSharesDataSource(),
data_record.NewDataRecordDataSource(),
publisher.NewPublisherDataSource(),
rest.NewDataverseWebApiDatasource(),
capacity.NewTenantCapcityDataSource(),
tenant.NewTenantDataSource(),
Expand Down Expand Up @@ -96,6 +98,7 @@ func TestUnitPowerPlatformProviderHasChildResources_Basic(t *testing.T) {
authorization.NewUserResource(),
environment_settings.NewEnvironmentSettingsResource(),
data_record.NewDataRecordResource(),
publisher.NewPublisherResource(),
rest.NewDataverseWebApiResource(),
connection.NewConnectionResource(),
connection.NewConnectionShareResource(),
Expand Down
Loading