Skip to content

Commit 34c34fc

Browse files
Clean-up and fixes
1 parent dc0f7b3 commit 34c34fc

File tree

8 files changed

+79
-23
lines changed

8 files changed

+79
-23
lines changed

infrastructure/afd-apim-pe/create.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
],
5757
"metadata": {
5858
"kernelspec": {
59-
"display_name": "APIM Samples Python 3.12",
59+
"display_name": ".venv (3.12.10)",
6060
"language": "python",
61-
"name": "apim-samples"
61+
"name": "python3"
6262
},
6363
"language_info": {
6464
"codemirror_mode": {

infrastructure/apim-aca/create.ipynb

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,36 @@
1515
"cell_type": "code",
1616
"execution_count": null,
1717
"metadata": {},
18-
"outputs": [],
18+
"outputs": [
19+
{
20+
"name": "stdout",
21+
"output_type": "stream",
22+
"text": [
23+
"Initializing Infrastructure Notebook Helper with the following parameters:\n",
24+
"\n",
25+
"👉🏽 \u001b[1;34mLocation : eastus2\u001b[0m \n",
26+
"👉🏽 \u001b[1;34mInfrastructure : apim-aca\u001b[0m \n",
27+
"👉🏽 \u001b[1;34mIndex : 1\u001b[0m \n",
28+
"👉🏽 \u001b[1;34mAPIM SKU : Basicv2\u001b[0m \n",
29+
"\n",
30+
"👉🏽 \u001b[1;34mCurrent user : [email protected]\u001b[0m\n",
31+
"👉🏽 \u001b[1;34mCurrent user ID : 744cffd5-e99d-4cc0-9fe3-2d284e07a1c4\u001b[0m\n",
32+
"👉🏽 \u001b[1;34mTenant ID : 16b3c013-d300-468d-ac64-7eda0820b6d3\u001b[0m\n",
33+
"👉🏽 \u001b[1;34mSubscription ID : 5fb73327-9152-4f64-bf8a-90dc0cc4ad8f\u001b[0m\n",
34+
"\n",
35+
"🚀 Creating infrastructure...\n",
36+
"\n",
37+
" Infrastructure : apim-aca\n",
38+
" Index : 1\n",
39+
" Resource group : apim-infra-apim-aca-1\n",
40+
" Location : eastus2\n",
41+
" APIM SKU : Basicv2\n",
42+
"\n",
43+
"📁 Changed working directory to: C:\\Dev\\Azure-Samples\\Apim-Samples\\infrastructure\\apim-aca\n",
44+
"📝 Updated the policy XML in the bicep parameters file 'params.json'\n"
45+
]
46+
}
47+
],
1948
"source": [
2049
"from apimtypes import APIM_SKU, INFRASTRUCTURE\n",
2150
"from utils import InfrastructureNotebookHelper\n",
@@ -54,9 +83,9 @@
5483
],
5584
"metadata": {
5685
"kernelspec": {
57-
"display_name": "APIM Samples Python 3.12",
86+
"display_name": ".venv (3.12.10)",
5887
"language": "python",
59-
"name": "apim-samples"
88+
"name": "python3"
6089
},
6190
"language_info": {
6291
"codemirror_mode": {

infrastructure/simple-apim/clean-up.ipynb

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,27 @@
1111
},
1212
{
1313
"cell_type": "code",
14-
"execution_count": null,
14+
"execution_count": 1,
1515
"metadata": {},
16-
"outputs": [],
16+
"outputs": [
17+
{
18+
"name": "stdout",
19+
"output_type": "stream",
20+
"text": [
21+
"\n",
22+
"👉🏽 \u001b[1;34mCleaning up resources for simple-apim - 1\u001b[0m \n",
23+
"👉🏽 \u001b[1;34mResource group : apim-infra-simple-apim-1\u001b[0m \n",
24+
"👉🏽 \u001b[1;34mFound 1 resource(s) to clean up. Processing in parallel...\u001b[0m \n",
25+
"👉🏽 \u001b[1;34mStarting parallel cleanup of 1 resource(s) with 1 worker(s)...\u001b[0m \n",
26+
"👉🏽 \u001b[1;34mDeleting and purging apim 'apim-pwpn7jvwjh7em'...\u001b[0m \n",
27+
"\u001b[1;32m✓ Cleaned up apim 'apim-pwpn7jvwjh7em' (1/1)\u001b[0m ⌚ 15:32:07.104892 \n",
28+
"\n",
29+
"\u001b[1;32mAll 1 resource(s) cleaned up successfully!\u001b[0m ⌚ 15:32:07.104892 \n",
30+
"ℹ️ \u001b[1;32mDeleting resource group 'apim-infra-simple-apim-1'...\u001b[0m ⌚ 15:32:07.104892 \n",
31+
"ℹ️ \u001b[1;32mCleanup completed.\u001b[0m ⌚ 15:33:26.835597 \n"
32+
]
33+
}
34+
],
1735
"source": [
1836
"from apimtypes import INFRASTRUCTURE\n",
1937
"from infrastructures import cleanup_infra_deployments\n",
@@ -26,9 +44,9 @@
2644
],
2745
"metadata": {
2846
"kernelspec": {
29-
"display_name": "APIM Samples Python 3.12",
47+
"display_name": ".venv (3.12.10)",
3048
"language": "python",
31-
"name": "apim-samples"
49+
"name": "python3"
3250
},
3351
"language_info": {
3452
"codemirror_mode": {

samples/_TEMPLATE/create.ipynb

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"rg_location = 'eastus2'\n",
2727
"index = 1\n",
2828
"apim_sku = APIM_SKU.BASICV2 # Options: 'BASICV2', 'STANDARDV2', 'PREMIUMV2'\n",
29-
"deployment = INFRASTRUCTURE.AFD_APIM_PE\n",
29+
"deployment = INFRASTRUCTURE.AFD_APIM_PE # Options: see supported_infras below\n",
3030
"api_prefix = 'template-' # ENTER A PREFIX FOR THE APIS TO REDUCE COLLISION POTENTIAL WITH OTHER SAMPLES\n",
3131
"tags = ['tag1', 'tag2'] # ENTER DESCRIPTIVE TAGS\n",
3232
"\n",
@@ -56,7 +56,7 @@
5656
"# apis: List[API] = [api1, apin]\n",
5757
"apis: List[API] = []\n",
5858
"\n",
59-
"print_okbook initialized')"
59+
"print_ok('Notebook initialized')"
6060
]
6161
},
6262
{
@@ -89,7 +89,7 @@
8989
" apim_gateway_url = output.get('apimResourceGatewayURL', 'APIM API Gateway URL')\n",
9090
" apim_apis = output.getJson('apiOutputs', 'APIs')\n",
9191
"\n",
92-
" print_okoyment completed successfully')\n",
92+
" print_ok('Deployment completed successfully')\n",
9393
"else:\n",
9494
" print_error(\"Deployment failed!\")\n",
9595
" raise SystemExit(1)"
@@ -119,18 +119,27 @@
119119
"tests = ApimTesting(\"Template Sample Tests\", sample_folder, nb_helper.deployment)\n",
120120
"\n",
121121
"# Example API testing (uncomment and customize as needed)\n",
122-
"# api_subscription_key = apim_apis[0]['subscriptionPrimaryKey']\n",
122+
"# Determine endpoints, URLs, etc. prior to test execution\n",
123+
"# endpoints = utils.get_endpoints(deployment, rg_name)\n",
124+
"# endpoint_url = None\n",
125+
"# request_headers = None\n",
123126
"\n",
124-
"# Preflight: Check if the infrastructure architecture deployment uses Azure Front Door. If so, assume that APIM is not directly accessible and use the Front Door URL instead.\n",
125-
"# endpoint_url = utils.test_url_preflight_check(deployment, rg_name, apim_gateway_url)\n",
127+
"# if (endpoints.appgw_hostname and endpoints.appgw_public_ip):\n",
128+
"# endpoint_url = f'https://{endpoints.appgw_public_ip}'\n",
129+
"# request_headers: dict[str, str] = {\"Host\": endpoints.appgw_hostname}\n",
130+
"# else:\n",
131+
"# # Preflight: Check if the infrastructure architecture deployment uses Azure Front Door. If so, assume that APIM is not directly accessible and use the Front Door URL instead.\n",
132+
"# endpoint_url = utils.test_url_preflight_check(deployment, rg_name, apim_gateway_url)\n",
133+
"\n",
134+
"# ********** TEST EXECUTIONS **********\n",
126135
"\n",
127136
"# reqs = ApimRequests(afd_endpoint_url, api_subscription_key)\n",
128137
"# output = reqs.singleGet('/', msg = 'Calling API via Azure Front Door. Expect 200.')\n",
129138
"# tests.verify('expected_value' in output, True)\n",
130139
"\n",
131140
"tests.print_summary()\n",
132141
"\n",
133-
"print_okdone!')"
142+
"print_ok('All done!')"
134143
]
135144
}
136145
],

samples/authX-pro/create.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@
249249
],
250250
"metadata": {
251251
"kernelspec": {
252-
"display_name": "APIM Samples Python 3.12",
252+
"display_name": ".venv (3.12.10)",
253253
"language": "python",
254-
"name": "apim-samples"
254+
"name": "python3"
255255
},
256256
"language_info": {
257257
"codemirror_mode": {

samples/authX/create.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@
197197
],
198198
"metadata": {
199199
"kernelspec": {
200-
"display_name": "APIM Samples Python 3.12",
200+
"display_name": ".venv (3.12.10)",
201201
"language": "python",
202-
"name": "apim-samples"
202+
"name": "python3"
203203
},
204204
"language_info": {
205205
"codemirror_mode": {

samples/azure-maps/create.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@
191191
],
192192
"metadata": {
193193
"kernelspec": {
194-
"display_name": "APIM Samples Python 3.12",
194+
"display_name": ".venv (3.12.10)",
195195
"language": "python",
196-
"name": "apim-samples"
196+
"name": "python3"
197197
},
198198
"language_info": {
199199
"codemirror_mode": {

samples/general/create.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"\n",
2626
"rg_location = 'eastus2'\n",
2727
"index = 1\n",
28-
"apim_sku = APIM_SKU.STANDARDV2 # Options: 'BASICV2', 'STANDARDV2', 'PREMIUMV2'\n",
28+
"apim_sku = APIM_SKU.BASICV2 # Options: 'BASICV2', 'STANDARDV2', 'PREMIUMV2'\n",
2929
"deployment = INFRASTRUCTURE.SIMPLE_APIM # Options: see supported_infras below\n",
3030
"api_prefix = '' # Not defining a prefix for general as these APIs will live off the root\n",
3131
"tags = ['general']\n",

0 commit comments

Comments
 (0)