Skip to content

Refactor config + file funcs for deploymentStack#221

Open
haysch wants to merge 3 commits intoAzure:mainfrom
haysch:feature/correct-deploymentStack-delete-op
Open

Refactor config + file funcs for deploymentStack#221
haysch wants to merge 3 commits intoAzure:mainfrom
haysch:feature/correct-deploymentStack-delete-op

Conversation

@haysch
Copy link
Copy Markdown

@haysch haysch commented Jun 10, 2025

The current setup has some strict, and unnecessary, requirements for deploymentStack's delete action.

This PR aims to relax the requirements and bring the GH Action in line with the az stack group <create|delete|validate> documentation in terms of required/optional/unnecessary parameters.

Fixes #207

Currently, the deploymentStack configuration parsing is too strict in
terms of requirements, i.e., `deny-settings-mode` does not exists for
`delete` action.

In addition, the deploymentStack scope can be optionally specified for
`delete` action, however, the Azure Deployment Stack client does not
currently expose a `beginDeleteAtTenantScopeAndWait` similar to
Azure Deployment client, thus, the highest level of deletion is at
`SubscriptionScope` without a specified subscription ID,
which seems to be akin to `TenantScope`.
@haysch
Copy link
Copy Markdown
Author

haysch commented Jun 10, 2025

Hi @SydneyhSmith, an attempt to fix some of the inconsistencies.

I found that the DeploymentStacksClient provided by the Azure sdk-for-js does not contain a beginDeleteAtTenantScope similar to some of the other functions, so I went with the assumption that not specifying/requiring a subscription ID would result in same behavior when observing the createStacksClient function.
createDeploymentClient works in similar fashion, while having some tenant-scoped functions.

If there are any changes required or questions please let me know!
I haven't been able to perform an integration test towards Azure as I do not have an account for the purpose :)

haysch added 2 commits June 10, 2025 23:04
When working with deploymentStack, providing a template is not
required when using the `delete` action and can cause confusion.

This commit introduces a flag that determines whether or not a
missing template file is valid.
The default value is assumed to be `true` as it seems to have been
the case historically.
Ensure that the description and example is up-to-date.
@haysch haysch force-pushed the feature/correct-deploymentStack-delete-op branch from ffaacfa to d14ba50 Compare June 10, 2025 21:04
Comment thread examples/STACKS.md

This workflow runs on manual dispatch. It checks out the code, logs into Azure, and deletes a "Development" deployment stack in the `westus2` region using the specified template and parameters files.
This workflow runs on manual dispatch. It checks out the code, logs into Azure, and deletes the "Development" deployment stack at the provided scope.
Without a defined scope, the operation is executed at highest possible level.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I am a bit unsure on what exactly happens when I cannot test not providing a scope/ID.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason we don't want to require the scope to be defined if we are attempting to match az stack commands? In the docs, there are separate commands for each scope: az stack group delete, az stack mg delete, az stack sub delete

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think is the biggest gap in my knowledge/experience. Now that you point it out it makes sense.

In which case, if - for example - no resource group/ID is specified for az stack group, it would likely default to the default subscription (?)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe either resource group and name need to be provided or the stack resource id from looking at the examples and the error when trying az stack group delete: "Please enter the (stack name and resource group) or stack resource id".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That seems to be completely correct! I wonder why the stack docs are a bit more vague compared to az deployment - likely because it's much newer I imagine.

Will update the PR to require scope.

@tsmallig33 tsmallig33 self-assigned this Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mismatch between docs and action requirements

2 participants