Skip to content

Commit 7c026fa

Browse files
Refactor Azure Maps sample notebook and Bicep templates for improved clarity and functionality
1 parent dba0707 commit 7c026fa

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

samples/azure-maps/create.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@
3232
"rg_name = utils.get_infra_rg_name(deployment, index)\n",
3333
"supported_infrastructures = [INFRASTRUCTURE.SIMPLE_APIM, INFRASTRUCTURE.AFD_APIM_PE, INFRASTRUCTURE.APIM_ACA] # ENTER SUPPORTED INFRASTRUCTURES HERE, e.g., [INFRASTRUCTURE.AFD_APIM_PE, INFRASTRUCTURE.AFD_APIM_FE]\n",
3434
"utils.validate_infrastructure(deployment, supported_infrastructures)\n",
35-
"\n",
35+
"sample_folder = \"azure-maps\"\n",
3636
"# 3) Define the APIs and their operations and policies\n",
3737
"\n",
3838
"# Policies\n",
3939
"# Named values must be set up a bit differently as they need to have two surrounding curly braces\n",
40-
"map_async_geocode_batch_v1_keyauth_post_xml = utils.read_policy_xml('map_async_geocode_batch_v1_keyauth_post.xml')\n",
41-
"map_default_route_v2_aad_get_xml = utils.read_policy_xml('map_default_route_v2_aad_get.xml')\n",
42-
"map_geocode_v2_aad_get_xml = utils.read_policy_xml('map_geocode_v2_aad_get.xml')\n",
40+
"map_async_geocode_batch_v1_keyauth_post_xml = utils.read_policy_xml('map_async_geocode_batch_v1_keyauth_post.xml', sample_name=sample_folder)\n",
41+
"map_default_route_v2_aad_get_xml = utils.read_policy_xml('map_default_route_v2_aad_get.xml', sample_name=sample_folder)\n",
42+
"map_geocode_v2_aad_get_xml = utils.read_policy_xml('map_geocode_v2_aad_get.xml', sample_name=sample_folder)\n",
4343
"\n",
4444
"# Map API \n",
4545
"mapApi_v2_default_get = GET_APIOperation2('get-default-route','Get default route','/default/*','This is the default route that will allow all requests to go through to the backend api',map_default_route_v2_aad_get_xml)\n",
4646
"mapApi_v1_async_post = APIOperation('async-geocode-batch','Async Geocode Batch','/geocode/batch/async',HTTP_VERB.POST, 'Post geocode batch async endpoint',map_async_geocode_batch_v1_keyauth_post_xml)\n",
4747
"mapApi_v2_geocode_get = GET_APIOperation2('get-geocode','Get Geocode','/geocode','Get geocode endpoint',map_geocode_v2_aad_get_xml)\n",
48-
"api1 = API('map-api', 'Map API', '/map', 'This is the proxy for Azure Maps', operations=[mapApi_v2_default_get, mapApi_v1_async_post,mapApi_v2_geocode_get, mapApi_v2_foo], tags = tags, serviceUrl=azure_maps_url)\n",
48+
"api1 = API('map-api', 'Map API', '/map', 'This is the proxy for Azure Maps', operations=[mapApi_v2_default_get, mapApi_v1_async_post,mapApi_v2_geocode_get], tags = tags, serviceUrl=azure_maps_url)\n",
4949
"\n",
5050
"# APIs Array\n",
5151
"# apis: List[API] = [api1, apin]\n",
@@ -88,7 +88,7 @@
8888
" raise SystemExit(1)\n",
8989
"\n",
9090
"# 3) Run the deployment\n",
91-
"output = utils.create_bicep_deployment_group(rg_name, rg_location, deployment, bicep_parameters)\n",
91+
"output = utils.create_bicep_deployment_group(sample_folder, rg_name, rg_location, bicep_parameters)\n",
9292
"\n",
9393
"# 4) Print a deployment summary, if successful; otherwise, exit with an error\n",
9494
"if not output.success:\n",

samples/azure-maps/main.bicep

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ param appInsightsName string = 'appi-${resourceSuffix}'
1717
param userAssignedIdentityName string = 'uami-maps-${resourceSuffix}'
1818
param apis array = []
1919

20-
// [ADD RELEVANT PARAMETERS HERE]
21-
2220
// ------------------
2321
// RESOURCES
2422
// ------------------

0 commit comments

Comments
 (0)