The error No such host is known
typically indicates a DNS
or network
issue preventing your App Service from resolving the Kudu API. Verify that the kuduApiUrl is correctly formatted https://<your-app-name>.scm.azurewebsites.net/api/
. Check for network restrictions like VNet integration, NSGs, or outbound traffic limits. Ensure authentication settings, such as Azure AD, are not blocking access. Also, enabling Always On
may be required for proper functionality.
- Please make sure your App Service can reach the Kudu API by running the following command in the Kudu Console
yourappname.scm.azurewebsites.net
nslookup yourappname.scm.azurewebsites.net
If this fails, your App Service has a DNS or network restriction.
- Please allow
Outbound Access to Kudu API
, if using a VNet, Private Endpoints, or NSGs, check outbound settings in Azure Portal > App Service > Networking. Ensure DNS resolution works, and outbound traffic isn't blocked. In Access Restrictions, allow traffic to*.scm.azurewebsites.net
. - Avoid issues by using Managed Identity instead of hardcoded credentials.
Enable Managed Identity in Azure Portal > App Service > Identity > System Assigned by turning it ON.
Assign the Contributor
or WebJob Contributor
role to your App Service's Managed Identity in Azure Portal > Subscription or Resource Group > Access Control (IAM).
Update your code to use Managed Identity instead of username/password for Kudu API authentication.
var azureCredential = new DefaultAzureCredential();
var accessToken = await azureCredential.GetTokenAsync(new TokenRequestContext(new[] { "https://management.azure.com/.default" }));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Token);
var response = await client.PostAsync($"{kuduApiUrl}/stop", null);
- Check App Service Logs in Azure Portal > Diagnose and Solve Problems for network issues and detailed error messages.
Check the link below for more details on this issue.
Please accept as "Yes" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.
Let me know if you have any further Queries.