Skip to content

"Failed to read data source" when creating authenticationContextClassReferences #69

@oocx

Description

@oocx

I try to create a conditional access authentication context. I use the following code:

resource "msgraph_update_resource" "authctx_pim_role_activation" {
  url        = "identity/conditionalAccess/authenticationContextClassReferences/c2"
  api_version = "v1.0"
  body = {
    displayName = "Privileged Identity Management: Role Activation"
    description = "This context is used to apply conditional access policies to Privileged Identity Management (PIM) activations."
    isAvailable = true
  }

}

However, apply fails with this error:

Error: Failed to read data source
│ 
│   with module.conditional_access.msgraph_update_resource.authctx_pim_role_activation,
│   on conditional_access/main.tf line 64, in resource "msgraph_update_resource" "authctx_pim_role_activation":
│   64: resource "msgraph_update_resource" "authctx_pim_role_activation" {
│ 
│ GET
│ https://graph.microsoft.com/v1.0/identity/conditionalAccess/authenticationContextClassReferences/c2
│ --------------------------------------------------------------------------------
│ RESPONSE 201: 201 Created
│ ERROR CODE UNAVAILABLE
│ --------------------------------------------------------------------------------
│ {
│   "@odata.context": "[https://graph.microsoft.com/v1.0/$metadata#identity/conditionalAccess/authenticationContextClassReferences/$entity",](https://graph.microsoft.com/v1.0/$metadata#identity/conditionalAccess/authenticationContextClassReferences/$entity%22,)
│   "id": "c2",
│   "displayName": "Privileged Identity Management: Role Activation",
│   "description": "This context is used to apply conditional access policies to Privileged Identity Management (PIM) activations.",
│   "isAvailable": true
│ }

The authentication context was created successfully even though terraform reports an error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions