dotnet / dotnet/dotnet-api-docs
GetDomain does not work in Azure App Service
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
Hi Team,
I'm internal MSFT (in CSS, IIS/ASP.NET team), and I believe this call fails in an Azure App Service due to the App Service sandbox not allowing any calls to these ports: 137, 138, 139, and 445. The Forest.GetForest(DirectoryContext) method also fails. The error in both cases is:
System.UnauthorizedAccessException - "Access is denied"
This is reproducible by simply running a console app in an App Service with a DC that is reachable, and running GetDomain/GetForest with a user that is allowed to call the domain like this. LDAP calls work without issue, while these other calls do not.
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: b6f2062a-749a-3748-bb7e-577bf8607bc8
* Version Independent ID: 9a328368-d80b-9b98-88ac-48c0a36ef321
* Content: [Domain.GetDomain(DirectoryContext) Method (System.DirectoryServices.ActiveDirectory)](https://docs.microsoft.com/en-us/dotnet/api/system.directoryservices.activedirectory.domain.getdomain?view=netframework-4.7.2)
* Content Source: [xml/System.DirectoryServices.ActiveDirectory/Domain.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.DirectoryServices.ActiveDirectory/Domain.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**
Contributor guide
Assessment
This issue has not been assessed yet.