Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore(examples/templates/azure-windows): remove dependency on az CLI #16039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

phorcys420
Copy link
Member

@phorcys420 phorcys420 commented Jan 4, 2025

This PR makes it so that the az CLI is not necessary anymore to run the azure-windows template, and also unifies the README between the two Azure templates while we're at it.

@@ -31,5 +31,34 @@ This template provisions the following resources:

This means, when the workspace restarts, any tools or files outside of the data directory are not persisted. To pre-bake tools into the workspace (e.g. `python3`), modify the VM image, or use a [startup script](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/script).

> **Note**
> [!NOTE]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we render these within Coder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thinking, will check!

```hcl
# Stop the VM
resource "null_resource" "stop_vm" {
count = data.coder_workspace.me.transition == "stop" ? 1 : 0
Copy link
Member

@matifali matifali Jan 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

count = data.coder_workspave.me.start_count

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matifali I'm not sure though, the issue is that if we use it for stopping, then it will look something like count = data.coder_workspave.me.start_count == 1 ? 0 : 1, we should have data.coder_workspave.me.stop_count i think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"stop" ? 1 : 0 is fine. Adding a stop_count is too niche.

@matifali
Copy link
Member

matifali commented Jan 5, 2025

The PR title gives the impression that we are merging the templates into one which we aren't.

@phorcys420 phorcys420 changed the title chore: unify azure-linux and azure-windows templates chore(examples/templates/azure-windows): remove dependency on az CLI Jan 5, 2025
@phorcys420 phorcys420 merged commit 0870ff2 into main Jan 6, 2025
34 checks passed
@phorcys420 phorcys420 deleted the phorcys/azure-persistent-resources branch January 6, 2025 05:24
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants