Save file from App Service to on-premise network share - azure

I have a requirement to create and save file from web application hosted in Azure App Service (ASE, Linux) to Network share on-premise. Network share already exists and is being written to by applications which I don't have control over. App Service is blocking ports so I can't write to network share directly. Assuming Azure to On premise connection is configured correctly what options do I have?

Related

How to read data from azure VM data disk via app service which resides in same Vnet?

I am trying to read the data from azure VM data disk via app service, both are in the same Vnet and i have already configured the Vnet integration.
But I dont have any idea on how to access the vm from app service
Due to the App Service sandbox explicitly does not allow access to the ports necessary for SMB protocol (137/138/139/445), I am afraid we can not use network share in the app service. Check this article link that mentioned it under Restricted Outgoing Ports: https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox.
Alternatively, you can use Azure File Share and access using REST API.
You also could consider storing your data on Azure storage then either attaching Azure Storage to a Linux container App Service or attaching Azure Storage Files as a network share to a windows container in App Service.

Access on-prem resources via Azure

I'm trying to access on-prem resources (file share on a file server) via Azure, but I'm stuck and don't know how to continue.
On Prem: 1 Domain Controller and 1 File Server (Server 2019 Std). Both are joined to a local domain. The DC runs Azure AD Connect for sync.
Client: Laptop running Windows 10, joined to the Azure AD. Is in a different network.
Goal: Laptop should access the file share.
For sure I just could use a VPN or smth, but I'm trying to learn a bit Azure.
I'm referring to the following Microsoft Website: https://learn.microsoft.com/en-us/microsoft-365/business/access-resources
"You can also allow access to on-premises resources like line of business (LOB) apps, file shares, and printers. To allow access, use Azure AD Connect to synchronize your on-premises Active Directory with Azure Active Directory."
I dont think those are related at all. Network path must exist between your laptop and the file share. And the Azure AD Connect can help you with authentication\authorization, not with establishing the network connection. You should use VPN to establish network connectivity and you can use Azure AD Connect to sync identities to be able to use the same identity to access resources in the cloud\on-premises

How can I configure my azure app service to upload the files on my internal network using UNC path?

So, I have an app service hosted on azure and I want that app service to upload the files to my local server's shared folder. Local server has some software configured which processes those uploaded files.
In development environment everything works fine using UNC path for e.g. 10.197.1.65/Public/MyFolder/ and my application can copy the files over the network but I am not sure about how can I do that from app service.
I have encountered few solutions during my research like creating an ASE and VNET , Mapping of Azure Storage with my local drive etc., but I am not sure that which would be the feasible and proper approach.Thanks a lot.
You can't use UNC path from your app service due to that applications cannot connect to anywhere using ports 445, 137, 138, and 139 in the Restricted Outgoing Ports of Azure Web App sandbox.
As far as I know, the App service with VNet Integration is good to access or talk to the resource from a Virtual network or your on-premise network but you may need to deploy a site to site VPN gateway for your local environment. In this way, It does not support mounting a drive, but you can directly access the local data from your application.
For a Windows Container on App Service, It is a preview feature that you can mount an Azure Files share to a directory in your App Service app, then transfer data into Azure Files from your local machine. There are many methods you can interact with Azure file shares.

Azure Web app for containers to on-premises connection

Currently i'm hosting an API in an azure Web App for Containers App Service. Additionally, I have a logging database hosted on an on-premises service which can't be accessed publicly.
For accessing the on-premises service it is possible to create a hybrid connection; however this feature is not available through the Azure portal when using Web App for Containers as opposed to when using just a Web App.
Is it possible to create this Hybrid Connection programmatically or through the CLI?
Are there other methods of connecting to on-premises resources through azure?
The API is using ASP.NET Core.
I have been looking into the Microsoft.Azure.Relay package, but I seem to be unable to actually reach my on-premises endpoint through the samples supplied by the package.
Edit:
I have verified that i can make the Hybrid Connection using a Web App. To do this i have downloaded the Hybrid Connection Manager, installed it on the on-premises network and checked that an application can make HTTP calls to the endpoint at the end of the Hybrid Connection.
All of this is done through the azure portal by going into my Web App, then navigating to Networking, configuring Hybrid Connections and creating a Hybrid Connection, and connecting to the new Hybrid Connection through the Hybrid Connection Manager.
What i'm not capable of is doing the same for my Web App for Containers, as Networking is not a supported tap (yet?). Therefore, i'm looking for a programmatical way of doing this either through the CLI or in the sourcecode.

Azure to on premises web services

Can anybody tell me how to connect a web app running on azure to existing web services (.ASMX) on premises?
We do not have the source for the services they are exposed by third party applications and we do not want to open them up to public access.
Sounds like Azure's Service Bus Relay Service might be what you're looking for...
There might be three options based on your scenario. But I personally prefer the third one.
If you used azure cloud service (web role, worker role), you can use Windows Azure Connect. It builds an IP-sec communication between the azure machine and your local machine. Then you can connect to your local service through the its IPv6 address.
If you used azure virtual machine to host your azure project you can use Virtual Network. It's more powerful than the Windows Azure Connect.
You can use Windows Azure Service Bus Relay. It can open your local service to the cloud regardless how your azure project is hosted. But since it's only support WCF of Service Relay, and since you cannot change codes and config of your service, you might need some more works. Maybe you can create a small WCF on your local machine as a proxy, register it to Service Bus Relay, and pass all request/response to your local service.

Resources