PrateekKumarSingh / AzViz

⚡ ☁ Azure Visualizer aka 'AzViz' : A #powershell module to automatically generate Azure resource topology diagrams by just typing a PowerShell cmdlet and passing the name of one or more Azure Resource groups
MIT License
587 stars 146 forks source link

Could not install GraphViz on this system. #8

Closed ranand12 closed 3 years ago

ranand12 commented 4 years ago

Getting this error - the Install-GraphViz completed successfully too

image

PS C:\Users\us1\Downloads\AzViz-master\AzViz-master> Install-GraphViz VERBOSE: Performing the operation "Install Package" on target "Package 'Graphviz' version '2.38.0.20190211' from 'chocolatey'.". VERBOSE: NuGet: WARNING: The request was aborted: Could not create SSL/TLS secure channel. WARNING: NuGet: System.InvalidOperationException: Unable to find version '1.3.5.1' of package 'chocolatey-core.extension'. WARNING: NuGet: at NuGet.PackageRepositoryHelper.ResolvePackage(IPackageRepository sourceRepository, IPackageRepository localRepository, IPackageConstraintProvider constraintProvider, String packageId, SemanticVers ion version, Boolean allowPrereleaseVersions) WARNING: NuGet: at NuGet.PackageManager.InstallPackage(String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) WARNING: NuGet: at NuGet.Commands.InstallCommand.InstallPackage(IFileSystem fileSystem, String packageId, SemanticVersion version) WARNING: NuGet: at NuGet.Program.Main(String[] args) VERBOSE: Skipped Package 'chocolatey-core.extension v1.3.5.1' already installed VERBOSE: NuGet: WARNING: The request was aborted: Could not create SSL/TLS secure channel. WARNING: NuGet: System.InvalidOperationException: Unable to find version '2.38.0.20190211' of package 'Graphviz'. VERBOSE: Skipped Package 'Graphviz v2.38.0.20190211' already installed

PS C:\Users\us1\Downloads\AzViz-master\AzViz-master> Get-AzNetworkVizualization -ResourceGroups 'kubernetes' -ShowGraph -OutputFormat png -Verbose VERBOSE: Starting topology graph generation VERBOSE: Target resource groups: 'kubernetes' Export-PSGraph : Could not find GraphViz installed on this system. Please run 'Install-GraphViz' to install the needed binaries and libraries. This module just a wrapper around GraphViz and is looking for it in the following paths: C:\Program Files\NuGet\Packages\Graphviz\dot.exe or C:\program files\GraphViz*\bin\dot.exe or /usr/local/bin/dot or /usr/bin/dot. Optionally pass a path to your dot.exe file with the GraphVizPath parameter At C:\Users\us1\Downloads\AzViz-master\AzViz-master\src\public\Get-AzNetworkVizualization.ps1:199 char:9

VERBOSE: Graph Exported to path:

explodinghat commented 3 years ago

Just posted this on issue #12 which looks the same as this issue -

OK I think I've resolved this. Seems to be an error with the install-graphviz not installing graphviz into the right location. A workaround is to use the chocolatey version of graphviz, but that wasn't working either, because my machine(s) were using TLS1.3 to try and download chocolatey.

To resolve the TLS1.3 error (if you get it) - Powershell AS ADMIN:

New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server' -Force | Out-Null

New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server' -name 'Enabled' -value '0' -PropertyType 'DWord' -Force | Out-Null

New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server' -name 'DisabledByDefault' -value 1 -PropertyType 'DWord' -Force | Out-Null

New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client' -Force | Out-Null

New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client' -name 'Enabled' -value '0' -PropertyType 'DWord' -Force | Out-Null

New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client' -name 'DisabledByDefault' -value 1 -PropertyType 'DWord' -Force | Out-Null

Then change your .NET Framework default TLS version -powershell AS ADMIN:

reg add HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SystemDefaultTlsVersions /t REG_DWORD /d 1 /f /reg:64 reg add HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SystemDefaultTlsVersions /t REG_DWORD /d 1 /f /reg:32

Install chocolatey - powershell AS ADMIN:

iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Close and reopen powershell, then Install graphviz via chocolatey - powershell AS ADMIN:

choco install graphviz

You should then be able to run AzViz in a NON-ADMIN powershell session as per the instructions

Depending on how your executionpolicy is set (and whether or not you can change it) you might still be unable to run/ might need to run azviz as admin

I had to output the file instead of using showvisualization for it to work when running as admin - get-azviz -resourcegroup demo2 -theme light -verbose -outputformat png -OutputFilePath C:\Output\azure.png

PrateekKumarSingh commented 3 years ago

Removed this installation piece from the module and marked it as a prerequisite in the documentation. closing this issue now.