Error while connecting from webapp to blob storage

VV, Srivatsha 40 Reputation points
2023-07-26T04:54:19.93+00:00

We are trying to access some blob storages(different subscription) from our webapps(Java): There have already been some requests raised for VNet whitelisting and RBAC access for storage accounts. After that we're able to connect to the storage accounts from our local machine, but when connecting to the same from the webapps, we're getting the below error: "java.net.UnknownHostException: blob_name.blob.core.windows.net: Name does not resolve". I've checked the blob_name and other credentials, all are correct, but unable to find the reason.

Can I know the reason for the same and how to troubleshoot it.

Thank you.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,089 questions
{count} votes

Accepted answer
  1. Ramya Harinarthini_MSFT 5,346 Reputation points Microsoft Employee
    2023-07-26T05:29:39.4666667+00:00

    @VV, Srivatsha Welcome to Microsoft Q&A, Thank you for posting your here!!

    The error message you are encountering, "java.net.UnknownHostException: blob_name.blob.core.windows.net: Name does not resolve," indicates that the hostname for the blob storage endpoint cannot be resolved to an IP address. This is likely a networking or DNS-related issue, and there are a few common reasons why you might be experiencing this problem:

    VNet Configuration: Ensure that the Virtual Network (VNet) in which your web app is hosted has access to the storage account. You mentioned that VNet whitelisting has been requested, so it's crucial to confirm that the necessary network configuration has been properly set up to allow communication between your web app and the storage account.

    Network Security Group (NSG) Rules: Check if there are any Network Security Group rules that might be blocking outbound connections from your web app to the blob storage. NSGs can restrict network traffic, so ensure that the required ports for accessing the storage account are open.

    Custom DNS Resolution: In some scenarios, custom DNS settings might be affecting the name resolution from your web app. Ensure that you are using the default DNS configuration or the appropriate DNS settings that allow your web app to resolve the hostname for the storage endpoint.

    Proxy Configuration: If your web app is behind a proxy, ensure that the proxy settings are correctly configured to allow communication with the storage account.

    RBAC and Authentication: Double-check the Role-Based Access Control (RBAC) settings for the storage account and the associated authentication credentials used by your web app. Ensure that the correct credentials are being used to authenticate with the storage account.

    Firewall Restrictions: Check if there are any firewall rules in place that could be blocking outbound traffic from your web app to the internet. Some platforms allow you to set up firewall rules at the app level, so verify if there are any restrictions in place.

    Caching or Stale DNS Entries: It's possible that there are caching or stale DNS entries causing the issue. Wait for some time or try restarting your web app to see if the problem persists.

    To further diagnose the issue, you can try the following steps:

    Use nslookup or dig command to check if your web app can resolve the hostname for the storage account from the server where the web app is hosted. This will help determine if the DNS resolution is working as expected.

    Enable logging and diagnostics in your web app to get more detailed error messages that might shed light on the problem.

    Review the networking configuration for your web app and ensure that it is allowed to make outbound connections to external resources.

    If possible, try connecting to the storage account from a different environment to see if the issue is specific to your web app or a more general networking problem.

    If you have tried the above steps and are still unable to resolve the issue, you may need to involve your network administrators or platform support to investigate further.

    Hope this helps!
    Kindly let us know if the above helps or you need further assistance on this issue.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.