Azure Java function to add data in blob storage in different subscription

ChanLK 20 Reputation points
2023-11-29T20:29:19.6333333+00:00

I have 2 subscription lets say SUB-1 and SUB2

SUB-1 = Has the Azure function which gets triggered by the caller and adds the data in DB.

SUB-2 - Has the storage account.

My use case is I want modify the Function in SUB-1 to update the storage account in SUB-2. The option we tried to have the same function in SUB-2 however calling application also need to be reconfigured (not possible)

Instead we are thinking of modifying the function in SUB-1 to do the same (add the data in storage account in SUB-2). I have the code to add the record row in storage within the same subscription however any idea how can I do it in the cross subscription?

Any other better/cost effective way?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,393 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,055 questions
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,826 Reputation points
    2023-12-07T10:16:42.44+00:00

    @ChanLK Thanks for reaching out. Can you please confirm my understanding that you already have the azure function which has the output binding that stores the data to the database. Now you have the requirement where you want to store the same data/different data to the storage account that is in different subscription using the same function?

    If it is the above case, then you can create the storage account in sub2 and define one more output binding (as you can have multiple output binding) in your azure function in sub1 that uses the connection string of your storage account to store the blob data. For more on storage output binding please refer to this document.

    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.