From 042cdc8a9011390189fc4477cc805a0772c82903 Mon Sep 17 00:00:00 2001 From: seilor junior Date: Wed, 18 Feb 2026 15:55:48 -0300 Subject: [PATCH 1/4] changes for this issue https://github.com/Azure-Samples/AI-Gateway/issues/262 --- labs/backend-pool-load-balancing-tf/policy.xml | 3 +-- labs/backend-pool-load-balancing/policy.xml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/labs/backend-pool-load-balancing-tf/policy.xml b/labs/backend-pool-load-balancing-tf/policy.xml index 2201d1d4..4dfcc8a6 100644 --- a/labs/backend-pool-load-balancing-tf/policy.xml +++ b/labs/backend-pool-load-balancing-tf/policy.xml @@ -12,8 +12,7 @@ + first-fast-retry="true" condition="@(context.Response.StatusCode == 429 || context.Response.StatusCode == 503)"> diff --git a/labs/backend-pool-load-balancing/policy.xml b/labs/backend-pool-load-balancing/policy.xml index 056d16cc..866c53e5 100644 --- a/labs/backend-pool-load-balancing/policy.xml +++ b/labs/backend-pool-load-balancing/policy.xml @@ -5,7 +5,7 @@ - + From 6fbb0c3a0b48f8e0dca82dcb4efdaa1fa037cf1a Mon Sep 17 00:00:00 2001 From: Junior Date: Wed, 18 Feb 2026 16:06:38 -0300 Subject: [PATCH 2/4] Add write permission for issues in workflow --- .github/workflows/update-labs-config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-labs-config.yml b/.github/workflows/update-labs-config.yml index 43fde1c4..ac885302 100644 --- a/.github/workflows/update-labs-config.yml +++ b/.github/workflows/update-labs-config.yml @@ -21,6 +21,7 @@ on: permissions: contents: write pull-requests: write + issues: write jobs: update-labs-config: From 18ca1b1f077640f2c6d7f9476c8da1d160da1488 Mon Sep 17 00:00:00 2001 From: seilor junior Date: Thu, 19 Feb 2026 15:19:04 -0300 Subject: [PATCH 3/4] https://github.com/Azure-Samples/AI-Gateway/issues/230 --- labs/content-safety/content-safety.ipynb | 42 ++++++++++++++++++++---- labs/content-safety/main.bicep | 33 ++++++++++--------- 2 files changed, 53 insertions(+), 22 deletions(-) diff --git a/labs/content-safety/content-safety.ipynb b/labs/content-safety/content-safety.ipynb index 33a73533..865fe632 100644 --- a/labs/content-safety/content-safety.ipynb +++ b/labs/content-safety/content-safety.ipynb @@ -38,11 +38,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "metadata": {} }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "✅ \u001b[1;32mNotebook initialized\u001b[0m ⌚ 14:09:29.586513 \n" + ] + } + ], "source": [ "import os, sys, json\n", "sys.path.insert(1, '../../shared') # add the shared directory to the Python path\n", @@ -81,9 +89,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "⚙️ \u001b[1;34mRunning: az account show \u001b[0m\n", + "✅ \u001b[1;32mRetrieved az account\u001b[0m ⌚ 14:09:39.477474 [0m:4s]\n", + "👉🏽 \u001b[1;34mCurrent user: seilorjunior@microsoft.com\u001b[0m\n", + "👉🏽 \u001b[1;34mTenant ID: 16b3c013-d300-468d-ac64-7eda0820b6d3\u001b[0m\n", + "👉🏽 \u001b[1;34mSubscription ID: 08a7f106-3eed-4add-8328-3d18b01d8ef1\u001b[0m\n" + ] + } + ], "source": [ "output = utils.run(\"az account show\", \"Retrieved az account\", \"Failed to get the current az account\")\n", "\n", @@ -111,7 +131,15 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "⚙️ \u001b[1;34mRunning: az group show --name lab-content-safety \u001b[0m\n" + ] + } + ], "source": [ "# Create the resource group if doesn't exist\n", "utils.create_resource_group(resource_group_name, resource_group_location)\n", @@ -226,7 +254,7 @@ ], "metadata": { "kernelspec": { - "display_name": "myenv", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -240,7 +268,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.13.5" + "version": "3.13.12" } }, "nbformat": 4, diff --git a/labs/content-safety/main.bicep b/labs/content-safety/main.bicep index 7464a5f3..83f45ac9 100644 --- a/labs/content-safety/main.bicep +++ b/labs/content-safety/main.bicep @@ -40,23 +40,8 @@ module foundryModule '../../modules/cognitive-services/v3/foundry.bicep' = { } } -// 3. APIM Inference API -module inferenceAPIModule '../../modules/apim/v2/inference-api.bicep' = { - name: 'inferenceAPIModule' - params: { - policyXml: loadTextContent('policy.xml') - aiServicesConfig: foundryModule.outputs.extendedAIServicesConfig - inferenceAPIType: inferenceAPIType - inferenceAPIPath: inferenceAPIPath - configureCircuitBreaker: true - } -} - resource apim 'Microsoft.ApiManagement/service@2024-06-01-preview' existing = { name: 'apim-${resourceSuffix}' - dependsOn: [ - inferenceAPIModule - ] } // 4. Content Safety @@ -146,6 +131,24 @@ resource contentSafetyBackend 'Microsoft.ApiManagement/service/backends@2024-06- } } } + dependsOn: [ + apimModule + ] +} + +// 3. APIM Inference API - Must be deployed after Content Safety backend +module inferenceAPIModule '../../modules/apim/v2/inference-api.bicep' = { + name: 'inferenceAPIModule' + params: { + policyXml: loadTextContent('policy.xml') + aiServicesConfig: foundryModule.outputs.extendedAIServicesConfig + inferenceAPIType: inferenceAPIType + inferenceAPIPath: inferenceAPIPath + configureCircuitBreaker: true + } + dependsOn: [ + contentSafetyBackend + ] } // ------------------ From f36edc4b895314f0d12cb82d38c87f51fc83ece9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 19 Feb 2026 18:19:32 +0000 Subject: [PATCH 4/4] chore: update labs-config.json for changed labs [skip ci] --- docs/labs-config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/labs-config.json b/docs/labs-config.json index 1a11eb95..c1c583da 100644 --- a/docs/labs-config.json +++ b/docs/labs-config.json @@ -204,9 +204,9 @@ "authors": [ "vieiraae" ], - "githubPath": "https://github.com/Azure-Samples/AI-Gateway/tree/main/labs/content-safety", + "githubPath": "https://github.com/seilorjunior/AI-Gateway/tree/main/labs/content-safety", "tags": [], - "lastCommitDate": "2026-02-04T13:09:52.730Z" + "lastCommitDate": "2026-02-19T18:19:32.694Z" }, { "id": "finops-framework",