Skip to content

powerplatform_analytics_data_export resource #486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
11 tasks
mattdot opened this issue Oct 3, 2024 · 0 comments
Open
11 tasks

powerplatform_analytics_data_export resource #486

mattdot opened this issue Oct 3, 2024 · 0 comments
Labels
enhancement New feature or request resource terraform resource
Milestone

Comments

@mattdot
Copy link
Member

mattdot commented Oct 3, 2024

User Story

As a Terraform user, I want the powerplatform_analytics_data_export resource to configure the export of analytics / telemetry data from various power platform services to app insights or data lake.

Use case: [Describe specific scenario where this resource would be valuable in infrastructure automation]

Resource

Potential Terraform Configuration

# Sample Terraform config that describes how the new resource might look.

resource "powerplatform_analytics_data_export" "dataverse_to_appinsights" {
  name = "example"
  environment_id = "<guid>"
  provider = "CloudFlow" # Dataverse | CloudFlow | PowerApps

  # easy to use
  scenarios = {
    dataverse_dependencies_plugin_executions = true
    dataverse_dependencies_sdk_executions = false
    dataverse_exceptions_plugin_executions = false
  }

  # Alternative Approach ... easy to maintain
  scenarios = ["", "", ""]
   
  app_insights = {
        resource_group_name = ""
        resource_name = ""
        subscription_id=""
        app_insights_key=""
    }
}

resource "powerplatform_analytics_data_export" "powerapp_to_datalake" {
   provider = "PowerApps" # PowerApps | CloudFlow
   data_lake = {
      resource_group_name = ""
      resource_name = ""  # the storage account name
      azure_subscription_id=""
   }
}

Additional Validation Rules

  • Allow either data_lake or app_insights but not both in the same resource?

API documentation

Action Verb URL Status Codes Comments
Create POST https://na.csanalytics.powerplatform.microsoft.com/api/v1/sinks/lakes/connections 202 Datalake connections
Create POST https://na.csanalytics.powerplatform.microsoft.com/api/v2/sinks/appinsights/connections 202 AppInsights connections
Read GET https://na.csanalytics.powerplatform.microsoft.com/api/v1/connections 202 Datalake connections
Read GET https://na.csanalytics.powerplatform.microsoft.com/api/v2/connections 202 AppInsights connections
Delete DELETE https://na.csanalytics.powerplatform.microsoft.com/api/v1/sinks/Lakes/ids/<export_id>/sources/PowerAutomate 202 Datalake connections. export id is the full /subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Storage/storageAccounts/<storage_account_name> and is URL encoded so slashes in the id show up as %2F
Delete DELETE https://na.csanalytics.powerplatform.microsoft.com/api/v2/sinks/AppInsights/sources/AppInsight/connection/<connection id> AppInsights connections

JSON

{
  "value": [
    {
      "source": "PowerAutomate",
      "sink": {
        "type": "Lakes",
        "id": "/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Storage/storageAccounts/<storage_account_name>",
        "resourceName": "<storage_account_name>"
      },
      "scenarios": null,
      "status": "Pending",
      "packageName": null
    }
  ]
}

Definition of Done

  • Data Transfer Objects (dtos) in dto.go
  • Resource Model in model.go
  • API Client functions in api_{name}.go
  • Resource Implementation in resource_{name}.go
  • Unit Tests in resource_{name}_test.go for Happy Path, Error conditions, boundry cases
  • Acceptance Tests in resource_{name}_test.go for Happy Path
  • Resource Added to provider.go and provider_test.go
  • Example in the /examples folder
  • Schema documented using MarkdownDescription
  • Change log entry changie new -k added
  • Run make precommit before PR

See the contributing guide for more information about what's expected for contributions.

@mattdot mattdot added enhancement New feature or request resource terraform resource labels Oct 3, 2024
@mattdot mattdot added this to the P0 milestone Oct 3, 2024
@mattdot mattdot linked a pull request Feb 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request resource terraform resource
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants