NOVA-411: Hello World migrations, Bicep to Terraform & Selenium to Playwright#7
NOVA-411: Hello World migrations, Bicep to Terraform & Selenium to Playwright#7hugoglez-nc wants to merge 64 commits intomainfrom
Conversation
…nt and tf storage
| server: containerRegistryLoginServer | ||
| username: containerRegistryUsername | ||
| passwordSecretRef: 'registry-password' | ||
| } |
There was a problem hiding this comment.
Add backlog to switch to managed identity
| ] | ||
| scale: { | ||
| minReplicas: 1 | ||
| maxReplicas: 10 |
There was a problem hiding this comment.
Backlog generic http traffic keda scaling rule?
| ManagedIdentityResourceGroupName: 'rg-dev-devops-usc' | ||
| ContainerRegistryLoginServer: 'ncontracts.azurecr.io' | ||
| AzureResourceManagerSC: 'Dev-Limited' | ||
| ContainerRegistrySC: 'NContractsSC' |
There was a problem hiding this comment.
Can we use managed idenitity instead
There was a problem hiding this comment.
you mean use "mi-dev-devops-usc" instead of "NContractsSC"?
I tried that, but task Docker@2 expects a service connection, so the option is to create a new service connection using the new managed identity.
| workingDirectory: '$(Pipeline.Workspace)/s/helloworld/Infrastructure/Terraform' | ||
| inlineScript: | | ||
| # Define a unique state file key for this build | ||
| $STATE_FILE_KEY = "helloworld-$(EnvironmentName)-$(Build.BuildId).tfstate" |
There was a problem hiding this comment.
Are the state files going to accumulate forever? I want to show using the storage account but if these are going to be left around forever we should probably delete it as part of the teardown with a comment explaining why we stored it to begin with
There was a problem hiding this comment.
that's correct, this is something that I wanted to check with you: state files and docker images will accumulate, so we can backlog a ticket to add some clean-up tasks for hello-world docker images and tfstate files.
Currently, there are 112 tags in hello-world ACR repo, but I think the manage identity will need more permissions to do the clean-up.
| - checkout: self | ||
| path: s/helloworld | ||
|
|
||
| - task: TerraformInstaller@1 |
There was a problem hiding this comment.
To have the latest patches and features, but either way in provider.tf we are using this:
required_version = "~> 1.0"
The ~> symbol allows the minor version to be greater than 0, but keep the major version in 1.x to avoid any breaking changes with a major version change.
Migration to Terraform and Playwright
Infrastructure (Bicep → Terraform)
Infrastructure/Pipelines/container-app.bicepwith Terraform modules inInfrastructure/Terraform/helloworld-{env}-{buildId}.tfstate)container_namebased onEnvironmentNameparameterTesting (Selenium → Playwright)
HelloWorld.IntegrationTests/from NUnit + Selenium (Chrome) to NUnit + PlaywrightPage.Locator("#brandLink"))Breaking Changes
_Layout.cshtmlproviders.tf)pwsh playwright.ps1 installinstead of Chrome/ChromeDriverUpdated Docs
Infrastructure/Terraform/README.mddocuments pipeline integration and backend configuration