Skip to content

Commit

Permalink
Azure DevOps pipeline updated (#17)
Browse files Browse the repository at this point in the history
- Use one pipeline file that easily can use variable group if needed
- Add Artifact Identifier variable to allow for multiple logs when running multiple jobs in one workflow
- Other minor updates and fixes
  • Loading branch information
reijoh authored Oct 8, 2024
1 parent fa55857 commit a8324c1
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 867 deletions.
64 changes: 44 additions & 20 deletions .azuredevops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,56 +106,80 @@ If the environment is configured with **Approvers**, the job will require manual

### Variable Group

When using the Variable Group version of the pipeline, make sure the pipeline has permissions to get the values, and use the same variables described next.
When using a variable group, make sure the pipeline has permissions to get the values.

### Variables
Update the [pipeline](ms.azure.deploy.yml) and replace the `variables:` with section to only include the name of the variable group, for example:

- **AZURE_PROVIDERS**: A comma separated list of Azure resource providers.
```yaml
trigger: none
pr:
autoCancel: true
drafts: false

The pipeline create job will try to register the specified providers in addition to the providers that is detected in code by deployment validate.
name: Azure Deploy

Use the value **"disable"** to prevent the pipeline from trying to register Azure resource providers.
pool:
vmImage: ubuntu-latest

- **AZURE_PROVIDER_WAIT_SECONDS**: Seconds to wait between each provider status check.
variables:
- group: PROD_GROUP

- **AZURE_PROVIDER_WAIT_COUNT**: Times to check provider status before giving up.
stages:
- stage: Plan
```
- **AZURE_SUBSCRIPTION_ID**: The subscription ID in which to deploy the resources.
### Variables
- **COST_THRESHOLD**: Max acceptable estimated cost. Exceeding threshold causes plan to fail.
- **ARTIFACT_IDENTIFIER**: A unique identifier added to artifact name in case of multiple runs within one workflow.
- **CURRENCY**: Currency code to use for estimations. See allowed values at <https://github.com/TheCloudTheory/arm-estimator/wiki/Options#currency>
- **COST_THRESHOLD**: Max acceptable estimated cost. Exceeding threshold causes plan to fail.
- **ENVIRONMENT**: Name of the [environment](#get-started) to use for the [deploy job](#deploy-job).
- **LOCATION**: The Azure location to store the deployment metadata.
- **IN_CURRENCY**: Currency code to use for estimations. See allowed values at <https://github.com/TheCloudTheory/arm-estimator/wiki/Options#currency>
- **IN_LOCATION**: The Azure location to store the deployment metadata.
- **IN_MANAGEMENT_GROUP**: Management group to create deployment at for mg scope.
- **IN_PROVIDERS**: A comma separated list of Azure resource providers.
The pipeline create job will try to register the specified providers in addition to the providers that is detected in code by deployment validate.
Use the value **"disable"** to prevent the pipeline from trying to register Azure resource providers.
- **IN_RESOURCE_GROUP**: Resource group to create deployment at for group scope.
- **IN_TEMPLATE**: The template address. A path or URI to a file or a template spec resource id.
- **LOG_SEVERITY**: The log verbosity. Can be one of:
- **IN_TEMPLATE_PARAMS**: Deployment parameter values. Either a path, URI, JSON string, or `<KEY=VALUE>` pairs.

- **IN_SCOPE**: The deployment scope. Accepted: tenant, mg, sub, group.

- **IN_SEVERITY**: The log verbosity. Can be one of:

- ERROR - Only show errors, suppressing warnings.
- INFO - Standard log level.
- VERBOSE - Increase logging verbosity.
- DEBUG - Show all debug logs.

- **MANAGEMENT_GROUP**: Management group to create deployment at for mg scope.

- **RESOURCE_GROUP**: Resource group to create deployment at for group scope.
- **PSRULE_AZURE_RESOURCE_MODULE_NOWARN**: Suppresses a warning when the minimum version of Az.Resources module is not installed.

- **RULE_BASELINE**: The name of a PSRule baseline to use. For a list of baseline names for module PSRule.Rules.Azure see <https://azure.github.io/PSRule.Rules.Azure/en/baselines/Azure.All/>

- **RULE_MODULES**: A comma separated list of modules to use for analysis. For a list of modules see <https://www.powershellgallery.com/packages?q=Tags%3A%22PSRule-rules%22>

- **RULE_OPTION**: The path to an options file. If empty, PSRule will be skipped.

- **SCOPE**: The deployment scope. Accepted: tenant, mg, sub, group.

- **SERVICE_CONNECTION**: The Azure Resource Manager service connection name.

- **TEMPLATE**: The template address. A path or URI to a file or a template spec resource id.
- **SUBSCRIPTION_ID**: The subscription ID in which to deploy the resources.

- **VERSION_ACE**: Azure Cost Estimator version. If empty, cost estimator will be skipped. See versions at <https://github.com/TheCloudTheory/arm-estimator/releases>.

- **TEMPLATE_PARAMETERS**: Deployment parameter values. Either a path, URI, JSON string, or `<KEY=VALUE>` pairs.
- **WAIT_SECONDS**: Seconds to wait between each provider status check.

- **VERSION_ACE_TOOL**: Azure Cost Estimator version. If empty, cost estimator will be skipped. See versions at <https://github.com/TheCloudTheory/arm-estimator/releases>.
- **WAIT_COUNT**: Times to check provider status before giving up.

- **WORKFLOW_VERSION**: The version of the bicep-action scripts to use. See <https://github.com/innofactororg/bicep-action/tags>.

Expand Down
Loading

0 comments on commit a8324c1

Please sign in to comment.