This repository contains an Azure Function built with Python that converts XML files to JSON format using BlobTrigger and Blob Binding. The function listens for changes to a designated blob container in Azure Storage, and whenever a new XML file is uploaded, it automatically converts it to JSON and stores it in another blob container.
Before you can use this function, you must have the following:
- An Azure subscription
- An Azure Storage account
- VS Code 2019 or later with the Azure development workload installed
- Azure CLI installed (https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
- Clone this repository to your local machine.
- Open the
local.settings.json
andfunction.json
in VS Code. - Replace the placeholder values with your own connection string and container names. Replace the path according to yours.
- Run the function locally with the command
func start
Disclaimer: Remember to adapt the script according to your XML structure.
To deploy the function to Azure, you can follow these steps:
- Create a new Function App in Azure.
- Use the public feature in VS Code to publish the function to the new Function App.
- In the Azure Portal, configure the function's application settings to include the connection string and container names used by the function.
Once deployed and running, you can upload XML files to the blob container in your Azure Storage account. The function will automatically detect the new file, convert it to JSON, and store the resulting file in the output blob container.
This project is license under the MIT License