Skip to content

Commit

Permalink
fix: Fixing the expirationTime issue in `avm/res/desktop-virtualiza…
Browse files Browse the repository at this point in the history
…tion/scaling-plan` (#1413)

## Description

Module:  `avm/res/desktop-virtualization/scaling-plan`

The pipeline of this module failed because of a hardcoded parameter
`expirationTime` in the `dependencies.bicep`. This parameter must be set
to a date between one hour and 30 day from the time of the deployment.
The hardcoded value worked for some time and then (after 30 days)
stopped working.

With this PR, the `expirationTime` will be calculated dynamically based
on the current time and will be set to 'current time + 32 days'

Fixes #1382
Fixes #1081 



<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes #123
Fixes #456
Closes #123
Closes #456
-->

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.desktop-virtualization.scaling-plan](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.desktop-virtualization.scaling-plan.yml/badge.svg?branch=users%2Fkrbar%2FscalingPlanFix)](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.desktop-virtualization.scaling-plan.yml)
|

## Type of Change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utlities (Non-module effecting
changes)
- [x] Azure Verified Module updates:
- [x] Bugfix containing backwards compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [x] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to day with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
krbar authored Mar 27, 2024
1 parent b1ea42b commit 106ea7f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ param tags object = {}
@description('Required. The name of the Managed Identity to create.')
param managedIdentityName string

@description('Optional. Expiration time of Host Pool registration token. Should be between one hour and 30 days from now and the format is like \'2023-12-24T12:00:00.0000000Z\'. If not provided, the expiration time will be set to two days from now.')
param expirationTime string = dateTimeAdd(utcNow(), 'P2D')

resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
name: managedIdentityName
location: location
Expand All @@ -27,7 +30,7 @@ resource hostPool 'Microsoft.DesktopVirtualization/hostPools@2022-09-09' = {
startVMOnConnect: false
validationEnvironment: false
registrationInfo: {
expirationTime: '2024-02-24T12:00:00.0000000Z'
expirationTime: expirationTime
token: null
registrationTokenOperation: 'Update'
}
Expand Down

0 comments on commit 106ea7f

Please sign in to comment.