Add proxy to Azure Maps#63
Merged
Merged
Conversation
…identity and SAS token caching in policies
simonkurtz-MSFT
requested changes
Jun 17, 2025
…ling in ApimRequests
…identity and SAS token caching in policies
…ling in ApimRequests
- Updated the Azure Maps Jupyter notebook to include output messages for resource group initialization and deployment completion. - Modified the API definitions in the notebook to remove unnecessary sample folder references and ensure correct API operations are included. - Corrected the authentication method description in the notebook for the Default Route API. - Fixed a typo in the Bicep template comments regarding the Azure Maps Contributor role. - Removed the obsolete map_all_operations.xml file as it is no longer needed. - Adjusted the API service URL assignment in the Bicep module to handle cases where the service URL might be absent.
…identity and SAS token caching in policies
…ling in ApimRequests
- Updated the Azure Maps Jupyter notebook to include output messages for resource group initialization and deployment completion. - Modified the API definitions in the notebook to remove unnecessary sample folder references and ensure correct API operations are included. - Corrected the authentication method description in the notebook for the Default Route API. - Fixed a typo in the Bicep template comments regarding the Azure Maps Contributor role. - Removed the obsolete map_all_operations.xml file as it is no longer needed. - Adjusted the API service URL assignment in the Bicep module to handle cases where the service URL might be absent.
…clarity and functionality
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for proxying Azure Maps calls through API Management, showcasing three authentication methods (subscription key, Azure AD, and SAS tokens) and handling asynchronous operations.
- Extended the API model in Python to include a
serviceUrlproperty. - Added an asynchronous POST helper with polling to the
ApimRequestsclass. - Updated Bicep modules, sample policies, and deployment scripts for Azure Maps integration.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| shared/python/apimtypes.py | Added serviceUrl field and serialization in the API type |
| shared/python/apimrequests.py | Implemented _poll_async_operation and singlePostAsync methods |
| shared/bicep/modules/apim/v1/api.bicep | Mapped serviceUrl into the APIM API resource |
| samples/azure-maps/*.xml | Provided policy XML samples for each authentication method |
| samples/azure-maps/main.bicep | New sample Bicep deployment for Azure Maps with APIM |
| samples/azure-maps/create.ipynb | Notebook guiding deployment and testing of the sample |
| samples/azure-maps/README.md | Documentation for the Azure Maps APIM proxy sample |
| README.md | Added Azure Maps sample entry to the top-level README |
Comments suppressed due to low confidence (4)
samples/azure-maps/create.ipynb:25
- [nitpick] Using 'index' as a variable name may be ambiguous and shadow common built-ins; consider renaming to something more descriptive like 'sampleIndex'.
"index = 1\n",
shared/python/apimrequests.py:228
- The 'time' module is used here but not imported in this file, which will cause a NameError. Please add 'import time' at the top of the module.
start_time = time.time()
shared/python/apimtypes.py:186
- [nitpick] Including 'serviceUrl' in the output dictionary when it's None may lead to unexpected null values in serialized JSON. Consider conditionally adding this key only when 'serviceUrl' is set.
"serviceUrl": self.serviceUrl,
samples/azure-maps/README.md:1
- There's a typo in the title: 'proxing' should be spelled 'proxying'.
# Samples: Api Management proxing calls to Azure Maps
simonkurtz-MSFT
requested changes
Jun 19, 2025
simonkurtz-MSFT
left a comment
Member
There was a problem hiding this comment.
Thank you for setting all of this up, @anotherRedbeard!
…API testing and role assignments
…iled authentication methods and scenarios
simonkurtz-MSFT
approved these changes
Jun 19, 2025
simonkurtz-MSFT
left a comment
Member
There was a problem hiding this comment.
Looks awesome, @anotherRedbeard! Thank you for putting this together! Squash merge at will, please.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR should satisfy Feature Request #42. Added to show how to use Azure API Management (APIM) to proxy calls to the Azure Maps service. It will also show the 3 different authentication methods supported by APIM policies (subscription key, Azure Entra AD, and SAS Tokens).