Azure-Samples / Azure-Samples/cosmos-aks-samples

Bicep script fails

Open
#18 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
20
Forks
30
PR merge metrics
No merged PRs in 30d

Description

> Please provide us with the following information:
> ---------------------------------------------------------------

### This issue is for a: (mark with an `x`)
```
- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
```

### Minimal steps to reproduce
>
Follow the instructions to run the Bicep Script

### Any log messages given by the failure
>

Initially

```default
C:\Code\cosmos-aks-samples\Bicep\modules\cosmos\cosmos.bicep(62,9) : Warning use-parent-property: Resource "sqlRoleDefinition" has its name formatted as a child of resource "databaseAccount". The syntax can be simplified by using the parent property. [https://aka.ms/bicep/linter/use-parent-property]
C:\Code\cosmos-aks-samples\Bicep\modules\cosmos\cosmos.bicep(78,9) : Warning use-parent-property: Resource "sqlRoleAssignment" has its name formatted as a child of resource "databaseAccount". The syntax can be simplified by using the parent property. [https://aka.ms/bicep/linter/use-parent-property]
C:\Code\cosmos-aks-samples\Bicep\modules\cosmos\cosmos.bicep(88,9) : Warning use-parent-property: Resource "database" has its name formatted as a child of resource "databaseAccount". The syntax can be simplified by using the parent property. [https://aka.ms/bicep/linter/use-parent-property]
C:\Code\cosmos-aks-samples\Bicep\modules\cosmos\cosmos.bicep(97,9) : Warning use-parent-property: Resource "container" has its name formatted as a child of resource "database". The syntax can be simplified by using the parent property. [https://aka.ms/bicep/linter/use-parent-property]

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/d5321b42-b184-4a2c-a0fc-775c611da923/providers/Microsoft.Resources/deployments/CosmosDbAksDemo","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"DeploymentActive","message":"Unable to edit or replace deployment 'CosmosDbAksDemo': previous deployment from '5/24/2023 1:59:06 PM' is still active (expiration time is '5/31/2023 1:59:05 PM'). Please see https://aka.ms/arm-deploy-resources for usage details."}]}}

Then after making the changes suggested by the warnings on top

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/d5321b42-b184-4a2c-a0fc-775c611da923/providers/Microsoft.Resources/deployments/CosmosDbAksDemo","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidTemplateDeployment","message":"The template deployment 'aksCluster' is not valid according to the validation procedure. The tracking id is '4aa357c7-51d5-4d76-9d09-0588992638fc'. See inner errors for details.","details":[{"code":"PodIdentityAddonFeatureFlagNotEnabled","message":"Provisioning of resource(s) for container service AksDemoCosmosDbaks in resource group AksDemoCosmosDb failed. Message: PodIdentity addon is not allowed since feature 'Microsoft.ContainerService/EnablePodIdentityPreview' is not enabled. Please see https://aka.ms/aks/previews for how to enable features.. Details: "}]},{"code":"ResourceDeploymentFailure","target":"/subscriptions/d5321b42-b184-4a2c-a0fc-775c611da923/resourceGroups/AksDemoCosmosDb/providers/Microsoft.Resources/deployments/cosmosDB","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"DeploymentFailed","target":"/subscriptions/d5321b42-b184-4a2c-a0fc-775c611da923/resourceGroups/AksDemoCosmosDb/providers/Microsoft.Resources/deployments/cosmosDB","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"BadRequest","target":"/subscriptions/d5321b42-b184-4a2c-a0fc-775c611da923/resourceGroups/AksDemoCosmosDb/providers/Microsoft.Resources/deployments/cosmosDB","message":"{\r\n \"code\": \"BadRequest\",\r\n \"message\": \"The character 'A' at index 0 is not allowed in the DatabaseAccount name\\r\\nActivityId: c696292e-2709-46fd-97b3-06724e4153e8, Microsoft.Azure.Documents.Common/2.14.0\"\r\n}"}]}]}]}}
```

Seems like this feature is being deprecated, https://learn.microsoft.com/en-us/azure/aks/use-azure-ad-pod-identity , maybe that's why it doesn't work with Bicep?

### Expected/desired behavior
>
Infra deployed

### OS and Version?
> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Tried both, Cloud shell and Az CLI in terminal under win 11

### Versions
>

### Mention any other details that might be useful

To address the podidenity issue

az feature register --name EnablePodIdentityPreview --namespace Microsoft.ContainerService
az provider register -n Microsoft.ContainerService'

Then with that got another error about the AKS version, 1.22.11 no longer supported

> ---------------------------------------------------------------
> Thanks! We'll be in touch soon.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.