Skip to content
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

Allow "bring your own" Azure resource group and app plan? #83

Open
ericis opened this issue Dec 3, 2021 · 1 comment
Open

Allow "bring your own" Azure resource group and app plan? #83

ericis opened this issue Dec 3, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ericis
Copy link
Member

ericis commented Dec 3, 2021

  • Let devs define existing resource groups and do not destroy them
  • Let devs define existing app plans and do not destroy them (will need to verify the plan type is compatible though...)
@ericis ericis changed the title Allow "bring your own" Azure resource group and app plan Allow "bring your own" Azure resource group and app plan? Dec 3, 2021
@ericis ericis added the question Further information is requested label Dec 3, 2021
@ericis
Copy link
Member Author

ericis commented Dec 15, 2021

New support for idempotent cloud resources in some of the projects allows for existing Resource Groups and AppService Plans, but not all projects have been updated yet.

resource_group_exists_output=$(az group show \
--resource-group "$azure_resource_group" \
--output json 2>&1 || true)
if contains "$resource_group_exists_output" "ResourceGroupNotFound"; then
echo 'Creating Azure Resource Group...'
az group create \
--resource-group "$azure_resource_group" \
--location "$azure_region"
echo 'Successfully created Azure Resource Group.'
else
echo 'The Azure Resource Group already exists.'
fi

⚠️ However, the code still assumes to destroy the cloud infrastructure. This would need to be updated with a flag that defaulted to "off" to keep existing cloud infrastructure.

resource_group_exists_output=$(az group show \
--resource-group "$azure_resource_group" \
--output json 2>&1 || true)
if ! contains "$resource_group_exists_output" "ResourceGroupNotFound"; then
echo 'Deleting Azure Resource Group, including child resources...'
az group delete \
--name "$azure_resource_group" \
--yes
echo 'Successfully deleted the Azure Resource Group.'
else
echo 'The Azure Resource Group does not exist.'
fi

@ericis ericis added enhancement New feature or request help wanted Extra attention is needed and removed question Further information is requested labels Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant