I'm trying to replicate my deployment I had on AWS on azure. I had an entirely serverless based architecture on aws which consisted of aws lambda with s3 trigger, aws sagemaker processing job and aws ecr. The lambda would trigger the sagemaker processing job (using the python BOTO3 library) only if FILE A and FILE B are present. In the sense that I mention an if condition in my lambda function which says that only trigger the job if these 2 files are present. The lambda is triggered when I upload these 2 files. The aws has very extensive documentation about this and it has a specific path that I can mention that would then copy these files into sagemaker processing job container (opt/ml/processing). It also has a parameter to specify the algorithm or the docker image which can instruct the job what to do with the 2 files. Now I want to achieve the same on azure but having difficulty finding something similar here. I did however find something very similar which is the azure container instance which I can provision within the azure function which has a blob trigger. Now what I'm having difficulty is with how do I push these FILE A and FILE B inside the container? Also once the container is done doing whatever it's supposed to do, it generates a bunch of output files that need to stored somewhere. I need them to stored in a blob storage if possible.
What I want is to trigger the creation of an azure container instance when the function app is trigger. The function app will be triggered (blob trigger) when say FILE A and FILE B are uploaded. These files should then make their way inside the container. I've found a script :
def create_container_group(aci_client, resource_group,
container_group_name, container_image_name):
"""Creates a container group with a single container.
Arguments:
aci_client {azure.mgmt.containerinstance.ContainerInstanceManagementClient}
-- An authenticated container instance management client.
resource_group {azure.mgmt.resource.resources.models.ResourceGroup}
-- The resource group in which to create the container group.
container_group_name {str}
-- The name of the container group to create.
container_image_name {str}
-- The container image name and tag, for example:
microsoft\aci-helloworld:latest
"""
print("Creating container group '{0}'...".format(container_group_name))
# Configure the container
container_resource_requests = ResourceRequests(memory_in_gb=1, cpu=1.0)
container_resource_requirements = ResourceRequirements(
requests=container_resource_requests)
container = Container(name=container_group_name,
image=container_image_name,
resources=container_resource_requirements,
ports=[ContainerPort(port=80)])
# Configure the container group
ports = [Port(protocol=ContainerGroupNetworkProtocol.tcp, port=80)]
group_ip_address = IpAddress(ports=ports,
dns_name_label=container_group_name,
type="Public")
group = ContainerGroup(location=resource_group.location,
containers=[container],
os_type=OperatingSystemTypes.linux,
ip_address=group_ip_address)
But I have trouble on how I can transfer these files inside the container.

