Skip to content

Commit 871c7ed

Browse files
mawasileCopilotCopilot
authored
Request content was invalid and could not be deserialized could not find member makeronboardingurl (#1007)
* feat: add sharing configuration options to environment create response - Added `solutionCloudFlows-limitSharingMode`, `solutionCloudFlows-maxLimitUserSharing`, `bot-authoringSharingDisabled`, `bot-limitSharingMode`, and `bot-maxLimitUserSharing` fields to the environment create response JSON files. - Updated multiple test response files to reflect the new sharing configuration options. * fix: update API version in test responders to 2023-06-01 * fix: remove unsupported attributes and add new sharing options for managed environment * Update internal/services/managed_environment/models.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update internal/services/managed_environment/resource_managed_environment.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update internal/services/managed_environment/resource_managed_environment.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update internal/services/environment/dto.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update internal/services/managed_environment/resource_managed_environment.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update internal/services/managed_environment/resource_managed_environment.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update internal/services/managed_environment/resource_managed_environment.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update docs/resources/managed_environment.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update docs/resources/managed_environment.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update internal/services/managed_environment/resource_managed_environment.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * docs: Regenerate managed environment documentation after schema fixes (#1010) * Initial plan * docs: Regenerate managed environment documentation Co-authored-by: mawasile <50197777+mawasile@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mawasile <50197777+mawasile@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent ddc1763 commit 871c7ed

File tree

40 files changed

+494
-304
lines changed

40 files changed

+494
-304
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
kind: fixed
2+
body: powerplatform_managed_environment: removing no longer supported attributes (maker_onboarding_markdown, maker_onboarding_url); added new attributes (power_automate_is_sharing_disabled, copilot_allow_grant_editor_permissions_when_shared, copilot_limit_sharing_mode, copilot_max_limit_user_sharing)
3+
time: 2025-12-15T14:56:02.122421036Z
4+
custom:
5+
Issue: "1000"

docs/resources/managed_environment.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,18 @@ resource "powerplatform_environment" "development" {
3939
}
4040
4141
resource "powerplatform_managed_environment" "managed_development" {
42-
environment_id = powerplatform_environment.development.id
43-
is_usage_insights_disabled = true
44-
is_group_sharing_disabled = true
45-
limit_sharing_mode = "ExcludeSharingToSecurityGroups"
46-
max_limit_user_sharing = 10
47-
solution_checker_mode = "Warn"
48-
suppress_validation_emails = true
49-
solution_checker_rule_overrides = toset(["meta-avoid-reg-no-attribute", "meta-avoid-reg-retrieve", "app-use-delayoutput-text-input"])
50-
maker_onboarding_markdown = "this is example markdown"
51-
maker_onboarding_url = "https://www.microsoft.com"
42+
environment_id = powerplatform_environment.development.id
43+
is_usage_insights_disabled = true
44+
is_group_sharing_disabled = true
45+
limit_sharing_mode = "ExcludeSharingToSecurityGroups"
46+
max_limit_user_sharing = 10
47+
solution_checker_mode = "Warn"
48+
suppress_validation_emails = true
49+
solution_checker_rule_overrides = toset(["meta-avoid-reg-no-attribute", "meta-avoid-reg-retrieve", "app-use-delayoutput-text-input"])
50+
power_automate_is_sharing_disabled = true
51+
copilot_allow_grant_editor_permissions_when_shared = false
52+
copilot_limit_sharing_mode = "ExcludeSharingToSecurityGroups"
53+
copilot_max_limit_user_sharing = 55
5254
}
5355
```
5456

@@ -58,17 +60,19 @@ resource "powerplatform_managed_environment" "managed_development" {
5860
### Required
5961

6062
- `environment_id` (String) Unique environment id (guid), of the environment that is managed by these settings
61-
- `is_group_sharing_disabled` (Boolean) Limits how widely canvas apps can be shared. See [Managed Environment sharing limits](https://learn.microsoft.com/power-platform/admin/managed-environment-sharing-limits) for more details.
63+
- `is_group_sharing_disabled` (Boolean) Limits how widely canvas apps can be shared. See [Managed Environment sharing limits](https://learn.microsoft.com/power-platform/admin/managed-environment-sharing-limits?tabs=new#canvas-app-sharing-rules) for more details.
6264
- `is_usage_insights_disabled` (Boolean) [Weekly insights digest for the environment](https://learn.microsoft.com/power-platform/admin/managed-environment-usage-insights)
63-
- `limit_sharing_mode` (String) Limits how widely canvas apps can be shared. See [Managed Environment sharing limits](https://learn.microsoft.com/power-platform/admin/managed-environment-sharing-limits) for more details
64-
- `maker_onboarding_markdown` (String) First-time Power Apps makers will see this content in the Studio. See [Maker welcome content](https://learn.microsoft.com/power-platform/admin/welcome-content) for more details.
65-
- `maker_onboarding_url` (String) Maker onboarding 'Learn more' URL. See [Maker welcome content](https://learn.microsoft.com/power-platform/admin/welcome-content) for more details.
65+
- `limit_sharing_mode` (String) Limits how widely canvas apps can be shared. See [Managed Environment sharing limits](https://learn.microsoft.com/power-platform/admin/managed-environment-sharing-limits?tabs=new#canvas-app-sharing-rules) for more details.
6666
- `max_limit_user_sharing` (Number) Limits how many users can share canvas apps. if 'is_group_sharing_disabled' is 'False', then this values should be '-1'
67-
- `solution_checker_mode` (String) Automatically verify solution checker results for security and reliability issues before solution import. See [Solution Checker enforcement](https://learn.microsoft.com/power-platform/admin/managed-environment-solution-checker) for more details.
67+
- `solution_checker_mode` (String) Automatically verify solution checker results for security and reliability issues before solution import. See [Solution Checker enforcement](https://learn.microsoft.com/power-platform/admin/managed-environment-solution-checker) for more details.
6868
- `suppress_validation_emails` (Boolean) Send emails only when a solution is blocked. If 'False', you'll also get emails when there are warnings
6969

7070
### Optional
7171

72+
- `copilot_allow_grant_editor_permissions_when_shared` (Boolean) Allow Power Automate Copilot to grant `Editor` permissions when agent is shared. See [Agent sharing rules](https://learn.microsoft.com/power-platform/admin/managed-environment-sharing-limits?tabs=new#agent-sharing-rules) for more details.
73+
- `copilot_limit_sharing_mode` (String) Limits how widely Copilot agents can be shared. Value `DisableSharing` will block granting `Viewer` permissions when sharing the agent. See [Agent sharing rules](https://learn.microsoft.com/power-platform/admin/managed-environment-sharing-limits?tabs=new#agent-sharing-rules) for more details.
74+
- `copilot_max_limit_user_sharing` (Number) Limits how many users can share copilot agents. If 'is_group_sharing_disabled' is 'False', then this value should be '-1'. See [Agent sharing rules](https://learn.microsoft.com/power-platform/admin/managed-environment-sharing-limits?tabs=new#agent-sharing-rules) for more details.
75+
- `power_automate_is_sharing_disabled` (Boolean) If set to `true`, sharing of solution-aware cloud flows is disabled. If set to `false`, people can share solution-aware cloud flows. See [Solution-aware cloud flow sharing rules](https://learn.microsoft.com/power-platform/admin/managed-environment-sharing-limits?tabs=new#solution-aware-cloud-flow-sharing-rules) for more details.
7276
- `solution_checker_rule_overrides` (Set of String) # Solution Checker Rules
7377

7478

examples/resources/powerplatform_managed_environment/resource.tf

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ resource "powerplatform_environment" "development" {
2222
}
2323

2424
resource "powerplatform_managed_environment" "managed_development" {
25-
environment_id = powerplatform_environment.development.id
26-
is_usage_insights_disabled = true
27-
is_group_sharing_disabled = true
28-
limit_sharing_mode = "ExcludeSharingToSecurityGroups"
29-
max_limit_user_sharing = 10
30-
solution_checker_mode = "Warn"
31-
suppress_validation_emails = true
32-
solution_checker_rule_overrides = toset(["meta-avoid-reg-no-attribute", "meta-avoid-reg-retrieve", "app-use-delayoutput-text-input"])
33-
maker_onboarding_markdown = "this is example markdown"
34-
maker_onboarding_url = "https://www.microsoft.com"
25+
environment_id = powerplatform_environment.development.id
26+
is_usage_insights_disabled = true
27+
is_group_sharing_disabled = true
28+
limit_sharing_mode = "ExcludeSharingToSecurityGroups"
29+
max_limit_user_sharing = 10
30+
solution_checker_mode = "Warn"
31+
suppress_validation_emails = true
32+
solution_checker_rule_overrides = toset(["meta-avoid-reg-no-attribute", "meta-avoid-reg-retrieve", "app-use-delayoutput-text-input"])
33+
power_automate_is_sharing_disabled = true
34+
copilot_allow_grant_editor_permissions_when_shared = false
35+
copilot_limit_sharing_mode = "ExcludeSharingToSecurityGroups"
36+
copilot_max_limit_user_sharing = 55
3537
}
3638

internal/api/lifecycle.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ func (client *Client) DoWaitForLifecycleOperationStatus(ctx context.Context, res
5757
}
5858
tflog.Debug(ctx, "Location Header: "+locationHeader)
5959

60+
if locationHeader == "" {
61+
return nil, nil
62+
}
63+
6064
_, err := url.Parse(locationHeader)
6165
if err != nil {
6266
tflog.Error(ctx, "Error parsing location header: "+err.Error())

internal/api/request.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ import (
2424
)
2525

2626
func (client *Client) doRequest(ctx context.Context, token *string, request *http.Request, headers http.Header) (*Response, error) {
27+
if request == nil {
28+
return nil, errors.New("request is nil")
29+
}
30+
2731
if headers != nil {
2832
request.Header = headers
2933
}
@@ -85,10 +89,13 @@ func (client *Client) doRequest(ctx context.Context, token *string, request *htt
8589
StatusCode: apiResponse.StatusCode,
8690
Headers: apiResponse.Header,
8791
}
88-
tflog.Warn(ctx, "Detected Continuous Access Evaluation (CAE) challenge response", map[string]any{
89-
"url": request.URL.String(),
92+
logData := map[string]any{
9093
"statusCode": apiResponse.StatusCode,
91-
})
94+
}
95+
if request != nil {
96+
logData["url"] = request.URL.String()
97+
}
98+
tflog.Warn(ctx, "Detected Continuous Access Evaluation (CAE) challenge response", logData)
9299
return resp, caeError
93100
}
94101

internal/services/environment/dto.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,13 @@ type ExtendedSettingsDto struct {
132132
SolutionCheckerMode string `json:"solutionCheckerMode"`
133133
SuppressValidationEmails string `json:"suppressValidationEmails"`
134134
SolutionCheckerRuleOverrides string `json:"solutionCheckerRuleOverrides"`
135-
MakerOnboardingUrl string `json:"makerOnboardingUrl"`
136-
MakerOnboardingMarkdown string `json:"makerOnboardingMarkdown"`
135+
136+
SolutionCloudFlowsLimitSharingMode *string `json:"solutionCloudFlows-limitSharingMode"`
137+
// not exposed in PPAC UI yet, always set to -1
138+
SolutionCloudFlowsMaxLimitUserSharing *string `json:"solutionCloudFlows-maxLimitUserSharing"`
139+
BotAuthoringSharingDisabled *string `json:"bot-authoringSharingDisabled"`
140+
BotLimitSharingMode *string `json:"bot-limitSharingMode"`
141+
BotMaxLimitUserSharing *string `json:"bot-maxLimitUserSharing"`
137142
}
138143

139144
type LinkedEnvironmentMetadataDto struct {

internal/services/managed_environment/models.go

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ type ManagedEnvironmentResource struct {
1515
}
1616

1717
type ManagedEnvironmentResourceModel struct {
18-
Timeouts timeouts.Value `tfsdk:"timeouts"`
19-
Id types.String `tfsdk:"id"`
20-
EnvironmentId types.String `tfsdk:"environment_id"`
21-
ProtectionLevel types.String `tfsdk:"protection_level"`
22-
IsUsageInsightsDisabled types.Bool `tfsdk:"is_usage_insights_disabled"`
23-
IsGroupSharingDisabled types.Bool `tfsdk:"is_group_sharing_disabled"`
24-
MaxLimitUserSharing types.Int64 `tfsdk:"max_limit_user_sharing"`
25-
LimitSharingMode types.String `tfsdk:"limit_sharing_mode"`
26-
SolutionCheckerMode types.String `tfsdk:"solution_checker_mode"`
27-
SuppressValidationEmails types.Bool `tfsdk:"suppress_validation_emails"`
28-
MakerOnboardingUrl types.String `tfsdk:"maker_onboarding_url"`
29-
MakerOnboardingMarkdown types.String `tfsdk:"maker_onboarding_markdown"`
30-
SolutionCheckerRuleOverrides types.Set `tfsdk:"solution_checker_rule_overrides"`
18+
Timeouts timeouts.Value `tfsdk:"timeouts"`
19+
Id types.String `tfsdk:"id"`
20+
EnvironmentId types.String `tfsdk:"environment_id"`
21+
ProtectionLevel types.String `tfsdk:"protection_level"`
22+
IsUsageInsightsDisabled types.Bool `tfsdk:"is_usage_insights_disabled"`
23+
IsGroupSharingDisabled types.Bool `tfsdk:"is_group_sharing_disabled"`
24+
MaxLimitUserSharing types.Int64 `tfsdk:"max_limit_user_sharing"`
25+
LimitSharingMode types.String `tfsdk:"limit_sharing_mode"`
26+
SolutionCheckerMode types.String `tfsdk:"solution_checker_mode"`
27+
SuppressValidationEmails types.Bool `tfsdk:"suppress_validation_emails"`
28+
SolutionCheckerRuleOverrides types.Set `tfsdk:"solution_checker_rule_overrides"`
29+
PowerAutomateIsSharingDisabled types.Bool `tfsdk:"power_automate_is_sharing_disabled"`
30+
CopilotAllowGrantPermissionsWhenShared types.Bool `tfsdk:"copilot_allow_grant_editor_permissions_when_shared"`
31+
CopilotLimitSharingMode types.String `tfsdk:"copilot_limit_sharing_mode"` // noLimit, excludeSharingToSecurityGroups
32+
CopilotMaxLimitUserSharing types.Int64 `tfsdk:"copilot_max_limit_user_sharing"`
3133
}
3234

3335
type SolutionCheckerRulesArrayDto struct {

0 commit comments

Comments
 (0)