Error when using -FetchDnsRecordsFromAzureSubscription in Cloudshell
See original GitHub issueDescribe the bug When executing .\Get-DanglingDnsRecords.ps1 -FetchDnsRecordsFromAzureSubscription in CloudShell execution fails with the error: Import-Module: Line | 13 | … Import-Module -name $module -Scope Local -Force | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Assembly with same name is already loaded
Reproduce Steps to reproduce the behavior:
- Open CloudShell in Azure Portal
- Execute the following command in CloudShell
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Azure/Azure-Network-Security/master/Cross%20Product/Find%20Dangling%20DNS%20Records/Get-DanglingDnsRecords.ps1" -OutFile "Get-DanglingDnsRecords.ps1"
- Execute the following command in CloudShell
.\Get-DanglingDnsRecords.ps1 -FetchDnsRecordsFromAzureSubscription
- See error: Import-Module: Line | 13 | … Import-Module -name $module -Scope Local -Force | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Assembly with same name is already loaded
Expected behavior A list of dangling CNAME records for the subscription listed.
Environment- if applicable Azure portal CloudShell
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Azure DNS troubleshooting guide
This error means that Azure DNS was unable to allocate name servers for this DNS zone. Try using a different zone name.
Read more >Export/Get-DanglingDnsRecords.ps1 0.0.5
Export/Get-DanglingDnsRecords.ps1 ... To fetch DNS records from Azure subscription with subscription Id and DNS zone filters to reduce the scope of search.
Read more >Error when trying to fetch azure subscription rate card and ...
Headers.Authorization = new AuthenticationHeaderValue("Bearer", token); HttpResponseMessage response = HTTPClient.SendAsync(request).Result; // ...
Read more >Stopping Azure Subdomain Takeovers
The takeover occurs when a user has a DNS record that points to a deleted Aure ... This can also be performed from...
Read more >gcloud dns record-sets | Google Cloud CLI Documentation
cloud -shell ... error-reporting ... gcloud dns record-sets - manage the record-sets within your managed-zones. SYNOPSIS. gcloud dns record-sets GROUP ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue here also. Workaround in the cloud shell is to replace L373 with
$AZModules = ('Az.Dns')
as the Az.Accounts module already is loadedThanks for sharing the details, I see there are 2 version of Az.Accounts loaded Script 2.2.1 Az.Accounts (version loaded in memory) Script 2.2.2 Az.Accounts (version present in modules)
When the script tries to load the latest module it fails with the error, as another version of the module is currently loaded. Can you please wrap the lined in the code Import-Module -name $module -Scope Local -Force to below, and let us know the result.
if (-not (Get-Module -Name $module)) { Import-Module -name $module -Scope Local -Force }
Will update code accordingly.