You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plan runs through without an issue, however, if I try to apply I get the following error:
│ Error: Failed to create/update resource
│
│ with module.Bastion.azapi_resource.linux_vm_jit_policy,
│ on .terraform/modules/Bastion/vms.tf line 97, in resource "azapi_resource" "linux_vm_jit_policy":
│ 97: resource "azapi_resource" "linux_vm_jit_policy" {
│
│ creating/updating Resource: (ResourceId
│ "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-XXXXX/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/bastion-linux-vm-jit-policy" / Api
│ Version "2020-01-01"): GET
│ https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-XXXXX/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/bastion-linux-vm-jit-policy
│ --------------------------------------------------------------------------------
│ RESPONSE 404: 404 Not Found
│ ERROR CODE: PolicyNotFound
│ --------------------------------------------------------------------------------
│ {
│ "error": {
│ "code": "PolicyNotFound",
│ "message": "Just-In-Time Network Access Policy '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-XXXXX/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/bastion-linux-vm-jit-policy' does not exist."
│ }
│ }
│ --------------------------------------------------------------------------------
Why is there even a GET Request sent? I want to create the resource, so it is expected that the resource does not exist. It kind of does not make sense to me how this behaves.
The text was updated successfully, but these errors were encountered:
A7exSchin
changed the title
Trying to create a policy results in 404 Policy not Found error
[1.15.0]Trying to create a policy results in 404 Policy not Found error
Dec 19, 2024
I believe it's caused by the upstream API. The azapi_resource makes a PUT request before creating the resource, to make sure the target resource doesn't exist. And yes, it's expected to receive a 404.
After making a PUT request to create the resource, azapi will make another GET request to check whether the resource is created, however it still returns 404.
Are you able to create the resource with other client tools? If not, I think it's better to open an Azure Support ticket to report the API bug.
[azapi provider version 1.15.0]
Hello there,
I am currently trying to create a JIT Policy for VMs. This is my configuration object:
The plan runs through without an issue, however, if I try to apply I get the following error:
Why is there even a GET Request sent? I want to create the resource, so it is expected that the resource does not exist. It kind of does not make sense to me how this behaves.
The text was updated successfully, but these errors were encountered: