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
$tfApplyResult = &terraform apply -auto-approve -json | |
$tfResultObjects = $tfApplyResult | ConvertFrom-Json | |
$try = 0 | |
if (($tfResultObjects.'@level' -match 'error').count -gt 0 -or $try -gt 5) { | |
Write-Host "Found $(($tfResultObjects.'@level' -match 'error').count) resources in error state." | |
Write-Host "Will try to import resources that are in error state." | |
foreach ($result in $tfResultObjects) { |
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
$storageAccountName = "xxx" | |
$blobName = "xxx" | |
$containerName = "xxx" | |
$destination = "$env:TMP\blob.json" | |
$stringToReplace = "xxx" | |
$stringToReplaceWith = "xxx" | |
try { | |
$ctx = New-AzStorageContext -StorageAccountName $storageAccountName | |
Write-Host -ForegroundColor Green "Downloading blob and creating snapshot." |
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
$sbResources = Get-AzResource | Where-Object ResourceType -EQ Microsoft.KeyVault/vaults | |
# Get-AzServiceBusAuthorizationRule -ResourceGroupName $sbResources[0].ResourceGroupName -Namespace $sbResources[0].Name | |
# Get-AzServiceBusNamespace -ResourceGroupName $sbResources[0].ResourceGroupName -Namespace $sbResources[0].Name | select * | |
foreach ($serviceBus in $sbResources) { | |
write-host "Collecting topics from $($serviceBus.Name)" | |
$topics = Get-AzServiceBusTopic -ResourceGroupName $serviceBus.ResourceGroupName -Namespace $serviceBus.Name | |
# Get-AzServiceBusTopic -ResourceGroupName $serviceBus.ResourceGroupName -Namespace $serviceBus.Name | select id |
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
# Connect-AzureAD | |
# Login-AzAccount | |
$env = "Acc" | |
$clientAppName = "SPN-Inventory-$($env)-AutomatedTestClient" | |
$serverAppName = "SPN-Inventory-$($env)-App" | |
$ownerAppName = "spn-inventory-api" | |
$newApp = New-AzADApplication -DisplayName $clientAppName |