-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates to add backup restore, tags everything, loadbalancer
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
networking/loadbalancer/loadbalancer-basic-create-cli.azcli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
########################################################################################### | ||
# Stormtrooper Project | ||
# MIT License - https://github.com/deltadan/stormtrooper | ||
# Copyright (c) 2018 Dan Patrick - @deltadan | ||
# | ||
#Script Purpose | ||
# - When moving VMs between resource groups or subscriptions you must remove restore points | ||
# - Locate VMs with Restore Point | ||
# - Delete Restore Points | ||
# - Must provide the name of the resource group - looks like: AzureBackupRG_eastus_1 | ||
# (these names are in portal, but show no resources) | ||
########################################################################################### | ||
|
||
rg=AzureBackupRG_regionNameHere_1 | ||
array=(backupJob1 backupJob2) | ||
|
||
for backupjobs in "${array[@]}" | ||
do | ||
az resource delete -g $rg \ | ||
-n $backupjobs \ | ||
--resource-type "Microsoft.Compute/restorePointCollections" \ | ||
--verbose | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
########################################################################################### | ||
# Stormtrooper Project | ||
# MIT License - https://github.com/deltadan/stormtrooper | ||
# Copyright (c) 2018 Dan Patrick - @deltadan | ||
# | ||
#Script Purpose | ||
# - Gets all Tags on All Resource Groups | ||
# - Adds the RG tags along with any exsisting resource Tags to All resources in subscription | ||
########################################################################################### | ||
rg=test | ||
groups=$(az group list --query [].name --output tsv) | ||
for rg in $groups | ||
do | ||
jsontag=$(az group show -n $rg --query tags) || true | ||
t=$(echo $jsontag | tr -d '"{},' | sed 's/: /=/g') || true | ||
r=$(az resource list -g $rg --query [].id --output tsv) || true | ||
for resid in $r | ||
do | ||
jsonrtag=$(az resource show --id $resid --query tags) || true | ||
rt=$(echo $jsonrtag | tr -d '"{},' | sed 's/: /=/g') || true | ||
az resource tag --tags $t$rt --id $resid || true | ||
done | ||
done |