Installing Invictus Framework
Prerequisites
obtain access SharedTo access the resources stored on Azure Storage and Azure Container Registry you have to request an SAS-token and Azure Container Registry password from coditproducts@codit.eu.
Container revisionsWe use Multiple Revision mode in our Container App deployments, which means that older revisions could clutter the Container App Environment. We provide a clean-up script that should be run after logging in on the correct subscription, but can be ran in Azure DevOps Pipelines as well.
Include VNET support Shared
Invictus includes network infrastructure which allows all its resources to run within an Azure Virtual Network (VNET).
Required deployment
-
An Azure Virtual Network
- Including two subnets, one each for:
- Private Endpoints
- Container App Environment
- The subnets must have the following services enabled
Microsoft.AzureCosmosDBMicrosoft.EventHubMicrosoft.KeyVaultMicrosoft.ServiceBusMicrosoft.Storage
- The Container App subnet must also have the delegation
Microsoft.App/environments
- Including two subnets, one each for:
-
Private DNS Zones (Bicep template)
privatelink.azurecr.ioprivatelink.blob.core.windows.netprivatelink.file.core.windows.netprivatelink.mongo.cosmos.azure.comprivatelink.queue.core.windows.netprivatelink.servicebus.windows.netprivatelink.table.core.windows.netprivatelink.table.cosmos.azure.comprivatelink.vaultcore.azure.netprivatelink.{regionName}.azurecontainerapps.io
- To be able to deploy the app code from an Azure DevOps pipeline you require a self hosted agent running on the same VNET with the following software installed:
- PowerShell
- Azure PowerShell
- Bicep CLI
Required role assignment
If the Invictus resources and the VNET are on different resource groups, then you need to assign the role of
Network Contributorto the Invictus resource group onto the VNET resource group.-
Download
Save installation script to your repository Shared
The
Invictus-GetSources.ps1script pulls the latest Invictus resources needed to deploy the Framework.Add variables to variable group Shared
Invictus installation requires secrets for authentication. Codit Software provides these for you. Create a variable group for them:
**{'{prefix}'}.Invictus.Installation**Invictus.Installation.StorageAccount.Name:invictusreleasesInvictus.Installation.StorageAccount.Dashboard.SasToken: value provided by Codit Software (if you're also deploying the Dashboard)Invictus.Installation.StorageAccount.Framework.SasToken: value provided by Codit SoftwareInfra.Environment.ACRUsername: value provided by Codit SoftwareInfra.Environment.ACRPassword: value provided by Codit Software
YAML Pipeline
Next step is to add YAML pipelines to build the Invictus for Azure Framework. Change the following example file according to your needs, for example change the trigger path:
paths:include:- /src/customer.azure.invictusFull YAML build pipeline example
pr: nonetrigger:branches:include:- main- feature/*paths:include:- /src/customer.azure.invictusparameters:- name: VersiondisplayName: Invictus Versiontype: stringdefault: '*'- name: useBetadisplayName: Use Betatype: stringdefault: $Falsepool:vmImage: 'windows-latest'stages:- stage: PackagedisplayName: PackagedependsOn: []variables:- group: prefix.invictus.installationjobs:- job: publishdisplayName: Build and Publish Frameworksteps:- checkout: selfclean: truepersistCredentials: true- task: PowerShell@2displayName: 'Pull Invictus sources'inputs:targetType: filePathfilePath: './scripts/Invictus-GetSources.ps1'arguments: >-StorageAccountName '$(Invictus.Installation.StorageAccount.Name)'-StorageSasToken '$(Invictus.Installation.StorageAccount.Framework.SasToken)'-StorageContainerName 'framework'-SaveLocation '$(Build.ArtifactStagingDirectory)'-UseBeta ${{ parameters.useBeta }}-Version ${{ parameters.version }}- task: PublishPipelineArtifact@1inputs:TargetPath: $(Build.ArtifactStagingDirectory)ArtifactName: frameworkpublishLocation: 'pipeline'Deploy
Create variable group Shared
Create a variable group (recommended: {prefix}.Invictus.{env}) for each the environments. The deployment uses this variable group and edits/adds variables based on the Bicep deployment output.
permit build service access to variable groupsMake sure the Project Collection Build Service has Administrator access to these variable groups (Pipelines > Library > Security)
Use
Deploy.ps1script for deploymentThe
Deploy.ps1PowerShell script is available in the downloaded Invictus sources and is the central point of contact for deploying Invictus products.Least-privileged Azure role assignments for the deploying identity
The identity running the Bicep deployment (the service principal used by your Azure DevOps service connection) needs the following least-privileged roles assigned on the target resource group or subscription:
Role Why It's Needed Container Apps ContributorCreate/update Container Apps environments, apps, authentication configurations and job definitions. Azure Event Hubs OwnerCreate/update Event Hubs namespaces, hubs and network rule sets. Container Registry ContributorCreate/update Azure Container Registry instances, locks, and network settings. DocumentDB Account ContributorCreate/update Cosmos DB accounts, MongoDB databases and collections. Managed Identity ContributorCreate/update user-assigned managed identities for Container Apps and functions. Key Vault AdministratorCreate/update Key Vaults, access policies and network ACLs. Log Analytics ContributorCreate/update Log Analytics workspaces and list workspace keys. Monitoring ContributorCreate/update Application Insights components and associated locks. Network ContributorCreate/update private endpoints, VNET subnets and private DNS zone groups. ReaderRead existing Private DNS zones when linking DNS zone groups for private endpoints. Service Bus Data OwnerCreate/update Service Bus namespaces, queues and network rule sets. Storage Account ContributorCreate/update storage accounts, file shares, blob, and table services. User Access AdministratorCreate role assignments ( Microsoft.Authorization/roleAssignments) and resource locks.Mandatory Parameters
Argument name Description arcNameThe name of the Azure Container Registry name to deploy the container images to. (Make sure to override also the containerRegistryNameBICEP parameter if you want a custom name.)arcPathThe Azure Container App registry base path to form the source image location of the container images. arcUsernameThe username credential to authenticate the Docker CLI. arcPasswordThe password credential to authenticate into the Docker CLI. resourcePrefixAn abbreviation to include in all the Azure resource names that Invictus deploys, often an environment name. resourceGroupNameThe name of the Azure resource group where the main Invictus components deploys to. variableGroupNameDevOps variable group to write the Bicep outputs to (ex. Invictus_CosmosDb_DbName).useBetaIndicates the environment of the Azure Container App registry where the deployment gets its container images. Optional Parameters
Argument name Default value Description artifactsPath$PSScriptRootPath on the Azure DevOps agent that stores the downloaded Invictus artifacts (publish and download build artifacts) resourceGroupLocation'West Europe' In case no resource group is available with the name resourceGroupName, the deployment uses this location to create such resource group.additionalTemplateParameters[]Custom named parameters for the Bicep template you wish to override. More on this below. versionlatestVersion of the published Invictus artifacts that the deployment should download and deploy on the client environment. Full YAML task example
- task: AzureCLI@2displayName: 'Azure CLI'env:SYSTEM_ACCESSTOKEN: $(System.AccessToken)inputs:azureSubscription: '[YOUR_SERVICE_CONNECTION]'scriptType: 'pscore'scriptLocation: 'inlineScript'inlineScript: |# Determine where the the provided Invictus 'Deploy.ps1' script is located$artifactsPath = ${{ variables['Pipeline.Workspace'] }} + '/_build/framework'$scriptPath = $artifactsPath + '/Deploy.ps1'& $scriptPath `-artifactsPath $artifactsPath `-version ${{parameters.Version}} `-useBeta false `-acrPath "invictusreleases.azurecr.io" `-acrUsername 'admin' `-acrPassword '<password>' `-resourcePrefix 'dev' `-resourceGroupName 'my-client-dev-rg' `-variableGroupName 'My.Client.Dev' `-identityProviderApplicationId '<app-id>' `-identityProviderClientSecret '<secret>' `Full YAML release pipeline example
pr: nonetrigger: noneresources:pipelines:# Name of the pipeline resource inside this workflow. Used to reference the pipeline resources later on (e.g. download artifacts).- pipeline: _build# Name of the pipeline in Azure Pipelinessource: 'customer.azure.invictus.framework.build'trigger: trueparameters:- name: "Version"type: stringdefault: "latest"- name: "UseBeta"type: stringdefault: "$false"pool:vmImage: 'ubuntu-latest'stages:- stage: deploy_devdisplayName: 'Deploy to Development'variables:- group: infra.dev- group: prefix.invictus.dev- group: prefix.invictus.installationjobs:- deployment: deploy_developmentdisplayName: 'Deploy to Development'environment: Developmentstrategy:runOnce:deploy:steps:- download: '_build'displayName: Download Artifact- task: AzureCLI@2env:SYSTEM_ACCESSTOKEN: $(System.AccessToken)inputs:azureSubscription: 'NameOfYourServiceConnection'scriptType: 'pscore'scriptLocation: 'scriptPath'ScriptPath: '$(Pipeline.Workspace)/_build/framework/Deploy.ps1'ScriptArguments: '-version ${{parameters.Version}} -location "West Europe" -useBeta ${{parameters.UseBeta}} -acrPath "invictusreleases.azurecr.io" -acrUsername $(Infra.Environment.ACRUsername) -acrPassword $(Infra.Environment.ACRPassword) -resourcePrefix $(Infra.Environment.ResourcePrefix) -artifactsPath $(Pipeline.Workspace)/_build/framework -resourceGroupName $(Infra.Environment.ResourceGroup) -variableGroupName invictus.$(Infra.Environment.ShortName) -devOpsObjectId "$(Infra.DevOps.Object.Id)" -identityProviderApplicationId "$(Infra.AzAD.Client.IdentityProviderApplicationId)" -identityProviderClientSecret "$(Infra.AzAD.Client.IdentityProviderClientSecret)" -containerAppsEnvironmentLocation "$(Infra.Environment.ContainerAppsEnvironmentLocation)"'- stage: deploy_prddisplayName: 'Deploy to Production'dependsOn: deploy_accvariables:- group: infra.prd- group: prefix.invictus.prd- group: prefix.invictus.installationjobs:- deployment: deploy_prddisplayName: 'Deploy to Production'environment: Productionstrategy:runOnce:deploy:steps:- download: '_build'displayName: Download Artifact- task: AzureCLI@2env:SYSTEM_ACCESSTOKEN: $(System.AccessToken)inputs:azureSubscription: 'NameOfYourServiceConnection'scriptType: 'pscore'scriptLocation: 'scriptPath'ScriptPath: '$(Pipeline.Workspace)/_build/framework/Deploy.ps1'ScriptArguments: '-version ${{parameters.Version}} -location "West Europe" -useBeta ${{parameters.UseBeta}} -acrPath "invictusreleases.azurecr.io" -acrUsername $(Infra.Environment.ACRUsername) -acrPassword $(Infra.Environment.ACRPassword) -resourcePrefix $(Infra.Environment.ResourcePrefix) -artifactsPath $(Pipeline.Workspace)/_build/framework -resourceGroupName $(Infra.Environment.ResourceGroup) -variableGroupName invictus.$(Infra.Environment.ShortName) -devOpsObjectId "$(Infra.DevOps.Object.Id)" -identityProviderApplicationId "$(Infra.AzAD.Client.IdentityProviderApplicationId)" -identityProviderClientSecret "$(Infra.AzAD.Client.IdentityProviderClientSecret)" -containerAppsEnvironmentLocation "$(Infra.Environment.ContainerAppsEnvironmentLocation)"'Bicep Template Parameters
Press / to filterShowing 72 parametersType Name Description acaIdentityNamedefault:invictus-${resourcePrefix}-aca-identityThe name of the user-assigned identity that pulls the container images from the Azure Container Registry.
aiResourcesLocationdefault:swedencentralnew since v6.3Location where the Framework deploys the Azure AI Foundray services.
aiServicesSubnetsnew since v6.3A list of subnet names to form the network rules for the Azure AI Foundry resource, useful for VNET deployments.
allowStorageAccountSharedKeyAccessdefault:nullIndicates whether the shared Azure Storage Account allows authentication via a shared key access.
appInsightsNamedefault:invictus-${resourcePrefix}-appinsThe name of the Azure Application Insights resource that tracks the general telemetry of the Framework components.
appInsightsSamplingPercentagedefault:1The sampling percentage for the Azure Application Insights that tracks the general telemetry of the Framework components.
approvedMessageSizeInBytesdefault:200000The maximum byte threshold where the PubSub component applies the claim-check functionality.
autoResubmitDeferredMessagesdefault:falseIndicates whether the PubSub component should automatically resubmit/recover an Azure Service Bus message older than the deferral time limit.
blobContainerPrefixdefault:invictusAn custom abbreviation to include in the claim-check Azure Blob Storage container name, used by the PubSub component.
caeVnetInfraRgNamedefault:invictus-${resourcePrefix}-cae-infraThe name of the Azure Container Apps infrastructure resource group (when VNET is enabled).
containerAppEnvironmentSubnetNameThe name of the subnet to form the network rules of the Azure Container App environment, useful for VNET deployments.
containerAppEnvironmentSubnetsA list of subnet names to form the network rules of all the Azure Container App resources, useful for VNET deployments.
containerAppsEnvironmentLocationdefault:resourceGroup().locationThe Azure location for the Azure Container Apps and their environment.
containerAppsEnvironmentNamedefault:invictus-${resourcePrefix}-caeThe name of the Azure Container App environment.
containerRegistryNameThe name of the Azure Container Apps registry that hosts the Framework components' container images.
containerRegistryUrldefault:${resourcePrefix}.acr.azurecr.ioThe server URL of the Azure Container Apps registry that hosts the Framework components' container images.
customApplicationIdsdefault:[]A list of additional IDs referring to custom Microsoft Entra ID applications that should also be able to access the Azure Container Apps hosting the Framework components.
customTagsdefault:{}A set of Azure resource tags to apply to all to the deployed Invictus resources.
deferralMessageThresholdInMinutesdefault:30new since v6.2The PubSub component will try to recover Azure Service Bus messages older than this time limit that were stuck in deferral.
devOpsObjectIddefault:deployer().objectIdThe object ID associated with the service principal of the enterprise application that the Azure DevOps service connection is created for.
disableStorageAccountPublicNetworkAccessdefault:falseIndicates whether the shared Azure Storage Account should disable public network access. If
true, only private endpoints or VNET integration are allowed.dnsZoneResourceGroupNamedefault:resourceGroup().nameThe name of the Azure resource group where the private DNS zone deploys to.
dnsZoneSubscriptionIddefault:subscription().subscriptionIdThe Azure subscription ID to control the private DNS zone throughout, useful for VNET deployments.
enableVnetSupportdefault:falseFeature flag to control whether the Framework deploys within a VNET.
exceptionHandlerFunctionNamedefault:inv-${resourcePrefix}-exceptionhandlerThe name of the Azure Container App deployed for the Exception Handler component.
exceptionHandlerScalingThe Azure Container App scaling options of the Exception Handler component.
identityProviderApplicationIdThe application ID of the Microsoft Entra ID app registration that facilitates managed identity authentication for the Azure Container Apps, hosting the Framework components.
identityProviderClientSecretThe client secret of the Microsoft Entra ID app registration that facilitates managed identity authentication for the Azure Container Apps, hosting the Framework components.
invictusExceptionHandlerFunctionLocalContainerImageThe URL that navigates to the Azure Container App image of the Exception Handler component.
invictusPubSubV2FunctionLocalContainerImageThe URL that navigates to the Azure Container App image of the PubSub component.
invictusRegexTranslatorFunctionLocalContainerImageThe URL that navigates to the Azure Container App image of the Regex Translator component.
invictusSequenceControllerFunctionLocalContainerImageThe URL that navigates to the Azure Container App image of the Sequence Controller component.
invictusTimeSequencerFunctionLocalContainerImageThe URL that navigates to the Azure Container App image of the Time Sequencer component.
invictusTranscoV2FunctionLocalContainerImageThe URL that navigates to the Azure Container App image of the Transco component.
invictusUserManagedIdentityNamedefault:invictus-user-managed-identityThe name of the Azure user managed identity that has access to all the deployed Azure Container App components.
invictusXmlJsonConverterFunctionLocalContainerImageThe URL that navigates to the Azure Container App image of the XML-JSON Converter component.
invictusXsdValidatorFunctionLocalContainerImageThe URL that navigates to the Azure Container App image of the XSD Validator component.
keyVaultEnablePurgeProtectiondefault:falseIndicates whether the shared Azure Key Vault should be protected against purging.
keyVaultNamedefault:invictus-${resourcePrefix}-vltThe name of the shared Azure Key Vault, used by all Framework components.
keyVaultSubnetsA list of subnet names to form the Azure Key Vault resource, useful for VNET deployments.
locationdefault:resourceGroup().locationThe main Azure location where Invictus deploys its resources, some advanced resources can be configured with their own location.
LogAnalyticsWorkspaceAppInsightsNamedefault:invictus-${resourcePrefix}-loganalytics-appinsightsThe name of the Azure Log Analytics workspace that collects all Azure Application Insights resources deployed.
messageStatusCacheDeleteAfterDaysdefault:30The time period (in days) after which the storage policy deletes the message status Azure Storage Account table.
pubSubSubscriptionLockTimeoutInMinutesdefault:1The amount of time in minutes the PubSub component locks an Azure Service Bus message received on a topic subscription.
pubsubV2FunctionNamedefault:inv-${resourcePrefix}-pubsub-v2The name of the Azure Container App deployed for the PubSub component.
pubSubV2ScalingThe Azure Container App scaling options of the PubSub component.
pubSubV2TopicNamedefault:pubsubv2routerThe name of the Azure Service Bus topic, used by the PubSub component to send/receive messages from.
regexTranslatorFunctionNamedefault:inv-${resourcePrefix}-regextranslatorThe name of the Azure Container App deployed for the Regex Translator component.
regexTranslatorScalingThe Azure Container App scaling options of the Regex Translator component.
resourcePrefixrequiredAn abbreviation to include in all the Azure resource names that Invictus deploys, often an environment name.
sequenceControllerFunctionNamedefault:inv-${resourcePrefix}-seqcontrollerThe name of the Azure Container App deployed for the Sequence Controller component.
sequenceControllerScalingThe Azure Container App scaling options of the Sequence Controller component.
serviceBusMessageTimeToLiveMinutesdefault:43200The time limit of the send Azure Service Bus messages by the PubSub component, see Microsoft's messages expiration for more details.
serviceBusNamespaceNamedefault:invictus-${resourcePrefix}-sbsThe name of the Azure Service Bus namespace resource where the PubSub component controls its messages.
serviceBusSkuNamedefault:enableVnetSupport ? Premium : StandardThe pricing tier of the Azure Service Bus, used by the PubSub component.
serviceBusSubnetsA list of subnet names to form the Azure Service Bus namespace resource, useful for VNET deployments.
storageAccountMinimumTLSVersiondefault:TLS1_2The minimum allowed TLS version of the shared Azure Storage Account, used by all Framework components.
storageAccountNamedefault:invictus${resourcePrefix}storeThe name of the shared Azure Storage Account, used by all Framework components.
storageAccountSubnetsA list of subnet names to form the Azure Storage Account resource, useful for VNET deployments.
storageAccountTypedefault:Standard_LRSThe pricing tier of the shared Azure Storage Account, used by all Framework components.
timesequencerFunctionNamedefault:inv-${resourcePrefix}-timesequencerThe name of the Azure Container App deployed for the Time Sequencer component.
timeSequencerScalingThe Azure Container App scaling options of the Time Sequencer component.
transcoV2FunctionNamedefault:inv-${resourcePrefix}-transco-v2The name of the Azure Container App deployed for the Transco component.
transcoV2ScalingThe Azure Container App scaling options of the Transco component.
useOpenAPIdefault:falsenew since v6.3Feature flag to control whether the Framework components deploys with OpenAPI/Swagger specifications
useResourceLocksdefault:trueFeature flag to control whether the deployed Azure resources have resource locks.
vnetNameThe name of the Azure Virtual Network (VNET) resource that forms the base for all network-related rules and subnets throughout.
vnetResourceGroupNamedefault:resourceGroup().nameThe name of the Azure resource group where the VNET network rules deploys to.
xmlJsonConverterFunctionNamedefault:inv-${resourcePrefix}-xmljsonconverterThe name of the Azure Container App deployed for the XML-JSON Converter component.
xmlJsonConverterScalingThe Azure Container App scaling options of the XML-JSON Converter component.
xsdValidatorFunctionNamedefault:inv-${resourcePrefix}-xsdvalidatorThe name of the Azure Container App deployed for the XML-JSON Converter component.
xsdValidatorScalingThe Azure Container App scaling options of the XSD Validator component.