Skip to content

Commit 530719f

Browse files
authored
Merge pull request #18 from AsBuiltReport/dev
v0.1.8 release
2 parents a6d1559 + 0340765 commit 530719f

File tree

9 files changed

+213
-24
lines changed

9 files changed

+213
-24
lines changed

.github/workflows/Release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,13 @@ jobs:
4141
TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
4242
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
4343
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
44-
44+
bsky-post:
45+
needs: publish-to-gallery
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: zentered/[email protected]
49+
with:
50+
post: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #Microsoft #Azure #AsBuiltReport #PowerShell"
51+
env:
52+
BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }}
53+
BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }}

AsBuiltReport.Microsoft.Azure.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"_comment_": "0 = Disabled, 1 = Enabled / Summary, 2 = Detailed, 3 = Comprehensive",
2020
"AvailabilitySet": 1,
2121
"Bastion": 1,
22+
"DnsPrivateResolver": 1,
2223
"ExpressRoute": 1,
2324
"Firewall": 1,
2425
"IpGroup": 1,
@@ -33,6 +34,8 @@
3334
"RouteTable": 1,
3435
"SiteRecovery": 1,
3536
"StorageAccount": 1,
37+
"Subscription": 1,
38+
"Tenant": 0,
3639
"VirtualNetwork": 1,
3740
"VirtualMachine": 1
3841
},

AsBuiltReport.Microsoft.Azure.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'AsBuiltReport.Microsoft.Azure.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.1.7'
15+
ModuleVersion = '0.1.8'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# :arrows_clockwise: Microsoft Azure As Built Report Changelog
22

3+
## [[0.1.8](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Azure/releases/tag/v0.1.8)] - 2024-11-13
4+
5+
### Added
6+
* Add support for DNS private resolver
7+
* Add Tenant and Subscription InfoLevels to toggle on/off
8+
9+
### Changed
10+
* Update GitHub release workflow to add post to Bluesky social platform
11+
312
## [[0.1.7](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Azure/releases/tag/v0.1.7)] - 2024-10-13
413

514
### Added

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The Microsoft Azure As Built Report currently supports reporting for the followi
4747
* Key Vaults
4848
* Load Balancers
4949
* Policies
50+
* Private DNS Resolvers
5051
* Route Tables
5152
* Storage Accounts
5253
* Subscriptions
@@ -90,8 +91,13 @@ Open a PowerShell terminal window and install each of the required modules.
9091
:warning: Microsoft Az 12.0.0 or higher is required. Please ensure older Az modules have been uninstalled.
9192

9293
```powershell
93-
install-module Az -MinimumVersion 12.0.0
94-
install-module AsBuiltReport.Microsoft.Azure
94+
# Install
95+
install-module Az -Repository PSGallery -MinimumVersion 12.0.0 -Force
96+
install-module AsBuiltReport.Microsoft.Azure -Repository PSGallery -Force
97+
98+
# Update
99+
update-module Az -Force
100+
update-module AsBuiltReport.Microsoft.Azure -Force
95101
```
96102

97103
### GitHub
@@ -112,6 +118,9 @@ _Note: You are not limited to installing the module to those example paths, you
112118
113119
The Microsoft Azure As Built Report utilises a JSON file to allow configuration of report information, options, detail and healthchecks.
114120
121+
> [!IMPORTANT]
122+
> Please rememeber to generate a new report JSON configuration file after each module update to ensure the report functions correctly.
123+
115124
A Microsoft Azure report configuration file can be generated by executing the following command;
116125
```powershell
117126
New-AsBuiltReportConfig -Report Microsoft.Azure -FolderPath <User specified folder> -Filename <Optional>
@@ -185,6 +194,7 @@ The table below outlines the default and maximum **InfoLevel** settings for each
185194
|-----------------------|:---------------:|:---------------:|
186195
| AvailabilitySet | 1 | 1 |
187196
| Bastion | 1 | 2 |
197+
| DnsPrivateResolver | 1 | 2 |
188198
| ExpressRoute | 1 | 2 |
189199
| Firewall | 1 | 3 |
190200
| IpGroup | 1 | 2 |
@@ -197,6 +207,8 @@ The table below outlines the default and maximum **InfoLevel** settings for each
197207
| RouteTable | 1 | 2 |
198208
| SiteRecovery | 1 | 1 |
199209
| StorageAccount | 1 | 2 |
210+
| Subscription | 1 | 1 |
211+
| Tenant | 1 | 1 |
200212
| VirtualNetwork | 1 | 2 |
201213
| VirtualMachine | 1 | 2 |
202214

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
function Get-AbrAzDnsPrivateResolver {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to retrieve Azure DNS Private Resolver information
5+
.DESCRIPTION
6+
7+
.NOTES
8+
Version: 0.1.0
9+
Author: Tim Carman
10+
Twitter: @tpcarman
11+
Github: tpcarman
12+
.EXAMPLE
13+
14+
.LINK
15+
16+
#>
17+
[CmdletBinding()]
18+
param (
19+
)
20+
21+
begin {
22+
Write-PScriboMessage "DnsPrivateResolver InfoLevel set at $($InfoLevel.DnsPrivateResolver)."
23+
}
24+
25+
process {
26+
Try {
27+
if ($InfoLevel.DnsPrivateResolver -gt 0) {
28+
$AzDnsPrivateResolvers = Get-AzDnsResolver | Sort-Object Name
29+
if ($AzDnsPrivateResolvers) {
30+
Write-PscriboMessage "Collecting Azure DNS Private Resolver information."
31+
Section -Style Heading4 'DNS Private Resolver' {
32+
if ($Options.ShowSectionInfo) {
33+
Paragraph "Azure Private DNS Resolver is a service that securely resolves DNS queries for private resources in Azure VNets, enabling seamless communication between on-premises and cloud environments without exposing traffic to the public internet. It centralises DNS management and supports hybrid cloud architectures."
34+
}
35+
$AzDnsPrivateResolverInfo = @()
36+
foreach ($AzDnsPrivateResolver in $AzDnsPrivateResolvers) {
37+
$AzResourceGroup = Get-AzResource -ResourceType $AzDnsPrivateResolver.Type
38+
$AzDnsResolverInboundEndpoint = Get-AzDnsResolverInboundEndpoint -DnsResolverName $AzDnsPrivateResolver.Name -ResourceGroupName $AzResourceGroup.ResourceGroupName
39+
$AzDnsResolverOutboundEndpoint = Get-AzDnsResolverOutboundEndpoint -DnsResolverName $AzDnsPrivateResolver.Name -ResourceGroupName $AzResourceGroup.ResourceGroupName
40+
$InObj = [Ordered]@{
41+
'Name' = $AzDnsPrivateResolver.Name
42+
'Resource Group' = $AzResourceGroup.ResourceGroupName
43+
'Location' = $AzLocationLookup."$($AzDnsPrivateResolver.Location)"
44+
'Subscription' = "$($AzSubscriptionLookup.(($AzDnsPrivateResolver.Id).split('/')[2]))"
45+
'Inbound Endpoints' = $AzDnsResolverInboundEndpoint.Count
46+
'Outbound Endpoints' = $AzDnsResolverOutboundEndpoint.Count
47+
'Virtual Network' = ($AzDnsPrivateResolver.VirtualNetworkId).split('/')[-1]
48+
'Resource Guid' = $AzDnsPrivateResolver.ResourceGuid
49+
'Creation Time' = get-date $AzDnsPrivateResolver.SystemDataCreatedAt.ToLocalTime() -format G
50+
'Last Modified' = get-date $AzDnsPrivateResolver.SystemDataLastModifiedAt.ToLocalTime() -format G
51+
'Current State' = $AzDnsPrivateResolver.State
52+
'Provisioning State' = $AzDnsPrivateResolver.ProvisioningState
53+
}
54+
55+
if ($Options.ShowTags) {
56+
$InObj['Tags'] = if ([string]::IsNullOrEmpty($AzResourceGroup.Tags)) {
57+
'None'
58+
} else {
59+
($AzResourceGroup.Tags.GetEnumerator() | ForEach-Object {"$($_.Key):`t$($_.Value)"}) -join [Environment]::NewLine
60+
}
61+
}
62+
63+
$AzDnsPrivateResolverInfo += [PSCustomObject]$InObj
64+
}
65+
66+
if ($InfoLevel.DnsPrivateResolver -ge 2) {
67+
Paragraph "The following sections detail the configuration of the DNS private resolver(s) within the $($AzSubscription.Name) subscription."
68+
foreach ($AzDnsPrivateResolver in $AzDnsPrivateResolverInfo) {
69+
Section -Style NOTOCHeading5 -ExcludeFromTOC "$($AzDnsPrivateResolver.Name)" {
70+
$TableParams = @{
71+
Name = "Private DNS Resolver - $($AzDnsPrivateResolver.Name)"
72+
List = $true
73+
ColumnWidths = 40, 60
74+
}
75+
if ($Report.ShowTableCaptions) {
76+
$TableParams['Caption'] = "- $($TableParams.Name)"
77+
}
78+
$AzDnsPrivateResolver | Table @TableParams
79+
80+
# Inbound Endpoints
81+
if ($AzDnsResolverInboundEndpoint) {
82+
Section -Style NOTOCHeading6 -ExcludeFromTOC 'Inbound Endpoints' {
83+
$InboundEndpointInfo = @()
84+
$InObj = [Ordered]@{
85+
'Endpoint Name' = $AzDnsResolverInboundEndpoint.Name
86+
'IP Address' = $AzDnsResolverInboundEndpoint.IPConfiguration.PrivateIPAddress
87+
'IP Allocation' = $AzDnsResolverInboundEndpoint.IPConfiguration.PrivateIPAllocationMethod
88+
}
89+
$InboundEndpointInfo += [PSCustomObject]$InObj
90+
91+
$TableParams = @{
92+
Name = "Inbound Endpoints - $($AzDnsPrivateResolver.Name)"
93+
List = $false
94+
ColumnWidths = 40, 30, 30
95+
}
96+
if ($Report.ShowTableCaptions) {
97+
$TableParams['Caption'] = "- $($TableParams.Name)"
98+
}
99+
$InboundEndpointInfo | Table @TableParams
100+
}
101+
}
102+
103+
# Outbound Endpoints
104+
if ($AzDnsResolverOutboundEndpoint) {
105+
Section -Style NOTOCHeading6 -ExcludeFromTOC 'Outbound Endpoints' {
106+
$OutboundEndpointInfo = @()
107+
$InObj = [Ordered]@{
108+
'Endpoint Name' = $AzDnsResolverOutboundEndpoint.Name
109+
'IP Address' = $AzDnsResolverOutboundEndpoint.IPConfiguration.PrivateIPAddress
110+
'IP Allocation' = $AzDnsResolverOutboundEndpoint.IPConfiguration.PrivateIPAllocationMethod
111+
}
112+
$OutboundEndpointInfo += [PSCustomObject]$InObj
113+
114+
$TableParams = @{
115+
Name = "Outbound Endpoints - $($AzDnsPrivateResolver.Name)"
116+
List = $false
117+
ColumnWidths = 40, 30, 30
118+
}
119+
if ($Report.ShowTableCaptions) {
120+
$TableParams['Caption'] = "- $($TableParams.Name)"
121+
}
122+
$OutboundEndpointInfo | Table @TableParams
123+
}
124+
}
125+
}
126+
}
127+
} else {
128+
Paragraph "The following table summarises the configuration of the DNS private resolver(s) within the $($AzSubscription.Name) subscription."
129+
BlankLine
130+
$TableParams = @{
131+
Name = "DNS Private Resolver - $($AzSubscription.Name)"
132+
List = $false
133+
Columns = 'Name', 'Resource Group', 'Location', 'Subscription'
134+
ColumnWidths = 25, 25, 25, 25
135+
}
136+
if ($Report.ShowTableCaptions) {
137+
$TableParams['Caption'] = "- $($TableParams.Name)"
138+
}
139+
$AzDnsPrivateResolverInfo | Table @TableParams
140+
}
141+
}
142+
}
143+
}
144+
} Catch {
145+
Write-PScriboMessage -IsWarning $($_.Exception.Message)
146+
}
147+
}
148+
149+
end {}
150+
}

Src/Private/Get-AbrAzSubscription.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ function Get-AbrAzSubscription {
1919
)
2020

2121
begin {
22-
Write-PscriboMessage "Collecting Azure Subscription information."
22+
Write-PScriboMessage "Subscription InfoLevel set at $($InfoLevel.Subscription)."
2323
}
2424

2525
process {
2626
Try {
27-
if ($AzSubscriptions) {
27+
if (($InfoLevel.Subscription -gt 0) -and ($AzSubscriptions)) {
28+
Write-PscriboMessage "Collecting Azure Subscription information."
2829
if ($Options.ShowSectionInfo) {
2930
Paragraph "An Azure subscription is a logical container used to provision resources in Azure. It holds the details of all your resources like virtual machines (VMs), databases, and more. When you create an Azure resource like a VM, you must identify the subscription it belongs to."
3031
BlankLine

Src/Private/Get-AbrAzTenant.ps1

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function Get-AbrAzTenant {
55
.DESCRIPTION
66
77
.NOTES
8-
Version: 0.1.1
8+
Version: 0.1.2
99
Author: Tim Carman
1010
Twitter: @tpcarman
1111
Github: tpcarman
@@ -19,29 +19,33 @@ function Get-AbrAzTenant {
1919
)
2020

2121
begin {
22-
Write-PscriboMessage "Collecting Azure Tenant information."
22+
Write-PScriboMessage "Tenant InfoLevel set at $($InfoLevel.Tenant)."
23+
2324
}
2425

2526
process {
2627
Try {
27-
$AzTenantInfo = [PSCustomObject]@{
28-
'Tenant Name' = $AzTenant.Name
29-
'Tenant ID' = $AzTenant.TenantId
30-
'Tenant Type' = $AzTenant.TenantType
31-
'Country ' = (Get-CountryName $AzTenant.CountryCode)
32-
'Domains' = $AzTenant.Domains -join ', '
33-
'Default Domain' = $AzTenant.DefaultDomain
34-
}
28+
if ($InfoLevel.Tenant -gt 0) {
29+
Write-PscriboMessage "Collecting Azure Tenant information."
30+
$AzTenantInfo = [PSCustomObject]@{
31+
'Tenant Name' = $AzTenant.Name
32+
'Tenant ID' = $AzTenant.TenantId
33+
'Tenant Type' = $AzTenant.TenantType
34+
'Country ' = (Get-CountryName $AzTenant.CountryCode)
35+
'Domains' = $AzTenant.Domains -join ', '
36+
'Default Domain' = $AzTenant.DefaultDomain
37+
}
3538

36-
$TableParams = @{
37-
Name = "Tenant - $($AzTenant.Name)"
38-
List = $true
39-
ColumnWidths = 40, 60
40-
}
41-
if ($Report.ShowTableCaptions) {
42-
$TableParams['Caption'] = "- $($TableParams.Name)"
39+
$TableParams = @{
40+
Name = "Tenant - $($AzTenant.Name)"
41+
List = $true
42+
ColumnWidths = 40, 60
43+
}
44+
if ($Report.ShowTableCaptions) {
45+
$TableParams['Caption'] = "- $($TableParams.Name)"
46+
}
47+
$AzTenantInfo | Table @TableParams
4348
}
44-
$AzTenantInfo | Table @TableParams
4549
} Catch {
4650
Write-PScriboMessage -IsWarning $($_.Exception.Message)
4751
}

Src/Public/Invoke-AsBuiltReport.Microsoft.Azure.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ function Invoke-AsBuiltReport.Microsoft.Azure {
9595
$AzContext = Set-AzContext -Subscription $AzSubscription.Id -Tenant $TenantId
9696
Get-AbrAzAvailabilitySet
9797
Get-AbrAzBastion
98+
Get-AbrAzDnsPrivateResolver
9899
Get-AbrAzExpressRouteCircuit
99100
Get-AbrAzFirewall
100101
Get-AbrAzIpGroup

0 commit comments

Comments
 (0)