Welcome to the Azure Rambi project! This repository contains code and resources for managing and deploying the Rambi Application using Azure services.
Azure Rambi is a project designed to simplify the management and deployment of Azure resources. It provides a set of tools and scripts to automate common tasks.
To get started with Azure Rambi, follow these steps:
- Clone the repository:
git clone https://github.com/bmoussaud/azure-rambi.git
- Navigate to the project directory:
cd azure-rambi
Install the required dependencies by running:
pip install -r requirements.txt
To use Azure Rambi, execute the following command:
python src/azurerambi/app.py
azd auth login
azd up
Warning: the provision phases include an APIM and A Redis Cache that can take a veryyyyyyy loooooong time to become available. Patience !
The infra/main.bicep
- CognitiveServices
- Open AI gpt-4
- Open AI dall-e-3
- Application Service Plan
- Web-App
- API Management
edit the file infra/authenticate_with_Azure_App_Service_for_GitHub.sh with your context and run it to grant a contributor to the resource group and to generate the secrets used by the GitHub action pipeline to deploy the differents components.
AZURE_CREDENTIALS
AZURE_SUBSCRIPTION_ID
- Service: Azure Application Service using the python runtime on linux
- CI/CD Pipeline: .github/workflows/main_azure-rambi.yml
Note: The bicep files come from: https://github.com/microsoft/AzureOpenAI-with-APIM/
The OpenAPI json file is available here: https://developer.themoviedb.org/openapi. You'll find the file for v3 and v4 version
The generate_movie
method has been moved to a new FastAPI service located in src/movie_generator_svc
. This service is configured to run in Azure Container Apps.
To deploy the new movie_generator_svc
service, follow these steps:
-
Build the Docker image:
docker build -t movie_generator_svc:latest src/movie_generator_svc
-
Push the Docker image to your container registry:
docker tag movie_generator_svc:latest <your-container-registry>/movie_generator_svc:latest docker push <your-container-registry>/movie_generator_svc:latest
-
Update the Azure Container Apps configuration to use the new image.
To use the new movie_generator_svc
service, make a POST request to the /generate
endpoint with the following JSON payload:
{
"movie1": {
"title": "Movie 1 Title",
"plot": "Movie 1 Plot",
"poster_url": "Movie 1 Poster URL"
},
"movie2": {
"title": "Movie 2 Title",
"plot": "Movie 2 Plot",
"poster_url": "Movie 2 Poster URL"
},
"genre": "Desired Genre"
}
The service will return a JSON response with the generated movie details.
We welcome contributions! Please read our contributing guidelines for more details.
This project is licensed under the MIT License. See the LICENSE file for more information.
- name: Build the image in the Azure Containe Registry
id: acr
uses: azure/acr-build@v1
with:
service_principal: ${{ secrets.AZURE_SERVICE_PRINCIPAL_ID }}
service_principal_password: ${{ secrets.AZURE_SERVICE_PRINCIPAL_PASSWORD }}
tenant: ${{ secrets.AZURE_TENANT_ID }}
registry: ${{ env.ACR_NAME }}
repository: azure-rambi
image: movie_poster_svc
tag: ${{ github.sha }}
folder: src/movie_poster_svc
git_access_token: ${{ secrets.GITHUB_TOKEN }}
branch: main