Showing posts with label azure. Show all posts
Showing posts with label azure. Show all posts

Friday, February 17, 2023

Azure Container Apps: Internal Server Error on provisioning ACA Environment in existing VNet

Product:

Azure Container Apps, Azure Virtual Networks

Problem:

As I was trying to set up ACA in an existing lab VNet, I discovered that some of my operations for creating the ACA Environment were failing with "Internal Server" error. 

Fortunately I've been through this type of obtuse error messaging from Azure before, so I was able to quickly walk back to what seemed to be causing my issue. 

Powershell received the following error:

New-AzContainerAppManagedEnv @EnvArgs
New-AzContainerAppManagedEnv : Internal server error occurred.  correlation ID: <snip>
At line:1 char:1
+ New-AzContainerAppManagedEnv @EnvArgs
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ({ SubscriptionI...    }
  }
} }:<>f__AnonymousType16`4) [New-AzContainer..._CreateExpanded], Exception
    + FullyQualifiedErrorId : InternalServerError,Microsoft.Azure.PowerShell.Cmdlets.App.Cmdlets.NewAzContainerAppManagedEnv_CreateExp
   anded

ARM deployments received multiple of the following error and then timed out: 

    "properties": {
        "statusCode": "InternalServerError",
        "serviceRequestId": null,
        "statusMessage": "{\"error\":{\"code\":\"InternalServerError\",\"message\":\"Internal server error occurred. correlation ID: <snip>\"}}",
        "eventCategory": "Administrative",
        "entity": "/subscriptions/<snip>/resourcegroups/<rgname>/providers/Microsoft.App/managedEnvironments/<envname>",
        "message": "Microsoft.App/managedEnvironments/write",
    },
 
 
Solution: 
Remove IPv6 address spaces from the VNet. 
 
HTH.  

Thursday, June 30, 2022

Terraform Azure Devops hosted pipelines

 In setting up my homelab using AZDO, I wanted to run some builds and steps using the Azure Hosted Agent. 

The documentation is a little unclear on this so I imported resources as follows. 

If codeblock output is clipped by css, don't worry, the code is there. Not working on that tonight as I have homelab to set up. 

For given TF code:

resource "azuredevops_agent_pool" "pipelinesagent" {
  name           = "Azure Pipelines"
  auto_provision = true
}

resource "azuredevops_agent_queue" "pipelinesqueue" {
  project_id    = azuredevops_project.project.id
  agent_pool_id = azuredevops_agent_pool.pipelinesagent.id
}

I found the azuredevops_agent_pool ID and the azuredevops_agent_queue ID as follows:

az pipelines queue list
// There were a lot of queues, but I am interested in the last in the output: 
// guids replaced with <guidhere>, get your own.
// 
[
{
    "id":  45,
    "name":  "Azure Pipelines",
    "pool":  {
                 "id":  9,
                 "isHosted":  true,
                 "isLegacy":  false,
                 "name":  "Azure Pipelines",
                 "options":  "none",
                 "poolType":  "automation",
                 "scope":  "<guidhere>",
                 "size":  1
             },
    "projectId":  "<guidhere>"
}
]

Now I can run my imports:

terraform import azuredevops_agent_pool.pipelinesagent 9
terraform import azuredevops_agent_queue.pipelinesqueue <guidhere>/45

And a `terraform apply` shows no changes needed.