[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-084435ad-3b2f-49f5-9b5b-00a77e3ba57d":3,"$fICy9T7kXL1kqoByFoKzpkEpZUSpw1U7BGfdP7eMZl8o":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"084435ad-3b2f-49f5-9b5b-00a77e3ba57d","azure-maps-search-dotnet","Azure Maps SDK for .NET。基于位置的服务，包括地理编码、路线规划、渲染、地理位置和天气。用于地址搜索、路线、地图瓦片、IP地理位置和天气数据。","cat_coding_devops","mod_coding","sickn33,coding","---\nname: azure-maps-search-dotnet\ndescription: Azure Maps SDK for .NET. Location-based services including geocoding, routing, rendering, geolocation, and weather. Use for address search, directions, map tiles, IP geolocation, and weather data.\nrisk: unknown\nsource: community\ndate_added: '2026-02-27'\n---\n\n# Azure Maps (.NET)\n\nAzure Maps SDK for .NET providing location-based services: geocoding, routing, rendering, geolocation, and weather.\n\n## Installation\n\n```bash\n# Search (geocoding, reverse geocoding)\ndotnet add package Azure.Maps.Search --prerelease\n\n# Routing (directions, route matrix)\ndotnet add package Azure.Maps.Routing --prerelease\n\n# Rendering (map tiles, static images)\ndotnet add package Azure.Maps.Rendering --prerelease\n\n# Geolocation (IP to location)\ndotnet add package Azure.Maps.Geolocation --prerelease\n\n# Weather\ndotnet add package Azure.Maps.Weather --prerelease\n\n# Resource Management (account management, SAS tokens)\ndotnet add package Azure.ResourceManager.Maps --prerelease\n\n# Required for authentication\ndotnet add package Azure.Identity\n```\n\n**Current Versions**:\n- `Azure.Maps.Search`: v2.0.0-beta.5\n- `Azure.Maps.Routing`: v1.0.0-beta.4\n- `Azure.Maps.Rendering`: v2.0.0-beta.1\n- `Azure.Maps.Geolocation`: v1.0.0-beta.3\n- `Azure.ResourceManager.Maps`: v1.1.0-beta.2\n\n## Environment Variables\n\n```bash\nAZURE_MAPS_SUBSCRIPTION_KEY=\u003Cyour-subscription-key>\nAZURE_MAPS_CLIENT_ID=\u003Cyour-client-id>  # For Entra ID auth\n```\n\n## Authentication\n\n### Subscription Key (Shared Key)\n\n```csharp\nusing Azure;\nusing Azure.Maps.Search;\n\nvar subscriptionKey = Environment.GetEnvironmentVariable(\"AZURE_MAPS_SUBSCRIPTION_KEY\");\nvar credential = new AzureKeyCredential(subscriptionKey);\n\nvar client = new MapsSearchClient(credential);\n```\n\n### Microsoft Entra ID (Recommended for Production)\n\n```csharp\nusing Azure.Identity;\nusing Azure.Maps.Search;\n\nvar credential = new DefaultAzureCredential();\nvar clientId = Environment.GetEnvironmentVariable(\"AZURE_MAPS_CLIENT_ID\");\n\nvar client = new MapsSearchClient(credential, clientId);\n```\n\n### Shared Access Signature (SAS)\n\n```csharp\nusing Azure;\nusing Azure.Core;\nusing Azure.Identity;\nusing Azure.ResourceManager;\nusing Azure.ResourceManager.Maps;\nusing Azure.ResourceManager.Maps.Models;\nusing Azure.Maps.Search;\n\n\u002F\u002F Authenticate with Azure Resource Manager\nArmClient armClient = new ArmClient(new DefaultAzureCredential());\n\n\u002F\u002F Get Maps account resource\nResourceIdentifier mapsAccountResourceId = MapsAccountResource.CreateResourceIdentifier(\n    subscriptionId, resourceGroupName, accountName);\nMapsAccountResource mapsAccount = armClient.GetMapsAccountResource(mapsAccountResourceId);\n\n\u002F\u002F Generate SAS token\nMapsAccountSasContent sasContent = new MapsAccountSasContent(\n    MapsSigningKey.PrimaryKey, \n    principalId, \n    maxRatePerSecond: 500, \n    start: DateTime.UtcNow.ToString(\"O\"), \n    expiry: DateTime.UtcNow.AddDays(1).ToString(\"O\"));\n\nResponse\u003CMapsAccountSasToken> sas = mapsAccount.GetSas(sasContent);\n\n\u002F\u002F Create client with SAS token\nvar sasCredential = new AzureSasCredential(sas.Value.AccountSasToken);\nvar client = new MapsSearchClient(sasCredential);\n```\n\n## Client Hierarchy\n\n```\nAzure.Maps.Search\n└── MapsSearchClient\n    ├── GetGeocoding()                    → Geocode addresses\n    ├── GetGeocodingBatch()               → Batch geocoding\n    ├── GetReverseGeocoding()             → Coordinates to address\n    ├── GetReverseGeocodingBatch()        → Batch reverse geocoding\n    └── GetPolygon()                      → Get boundary polygons\n\nAzure.Maps.Routing\n└── MapsRoutingClient\n    ├── GetDirections()                   → Route directions\n    ├── GetImmediateRouteMatrix()         → Route matrix (sync, ≤100)\n    ├── GetRouteMatrix()                  → Route matrix (async, ≤700)\n    └── GetRouteRange()                   → Isochrone\u002Freachable range\n\nAzure.Maps.Rendering\n└── MapsRenderingClient\n    ├── GetMapTile()                      → Map tiles\n    ├── GetMapStaticImage()               → Static map images\n    └── GetCopyrightCaption()             → Copyright info\n\nAzure.Maps.Geolocation\n└── MapsGeolocationClient\n    └── GetCountryCode()                  → IP to country\u002Fregion\n\nAzure.Maps.Weather\n└── MapsWeatherClient\n    ├── GetCurrentWeatherConditions()     → Current weather\n    ├── GetDailyForecast()                → Daily forecast\n    ├── GetHourlyForecast()               → Hourly forecast\n    └── GetSevereWeatherAlerts()          → Weather alerts\n```\n\n## Core Workflows\n\n### 1. Geocoding (Address to Coordinates)\n\n```csharp\nusing Azure;\nusing Azure.Maps.Search;\n\nvar credential = new AzureKeyCredential(subscriptionKey);\nvar client = new MapsSearchClient(credential);\n\nResponse\u003CGeocodingResponse> result = client.GetGeocoding(\"1 Microsoft Way, Redmond, WA 98052\");\n\nforeach (var feature in result.Value.Features)\n{\n    Console.WriteLine($\"Coordinates: {string.Join(\",\", feature.Geometry.Coordinates)}\");\n    Console.WriteLine($\"Address: {feature.Properties.Address.FormattedAddress}\");\n    Console.WriteLine($\"Confidence: {feature.Properties.Confidence}\");\n}\n```\n\n### 2. Batch Geocoding\n\n```csharp\nusing Azure.Maps.Search.Models.Queries;\n\nList\u003CGeocodingQuery> queries = new List\u003CGeocodingQuery>\n{\n    new GeocodingQuery() { Query = \"400 Broad St, Seattle, WA\" },\n    new GeocodingQuery() { Query = \"1 Microsoft Way, Redmond, WA\" },\n    new GeocodingQuery() { AddressLine = \"Space Needle\", Top = 1 },\n};\n\nResponse\u003CGeocodingBatchResponse> results = client.GetGeocodingBatch(queries);\n\nforeach (var batchItem in results.Value.BatchItems)\n{\n    foreach (var feature in batchItem.Features)\n    {\n        Console.WriteLine($\"Coordinates: {string.Join(\",\", feature.Geometry.Coordinates)}\");\n    }\n}\n```\n\n### 3. Reverse Geocoding (Coordinates to Address)\n\n```csharp\nusing Azure.Core.GeoJson;\n\nGeoPosition coordinates = new GeoPosition(-122.138685, 47.6305637);\nResponse\u003CGeocodingResponse> result = client.GetReverseGeocoding(coordinates);\n\nforeach (var feature in result.Value.Features)\n{\n    Console.WriteLine($\"Address: {feature.Properties.Address.FormattedAddress}\");\n    Console.WriteLine($\"Locality: {feature.Properties.Address.Locality}\");\n}\n```\n\n### 4. Get Boundary Polygon\n\n```csharp\nusing Azure.Maps.Search.Models;\n\nGetPolygonOptions options = new GetPolygonOptions()\n{\n    Coordinates = new GeoPosition(-122.204141, 47.61256),\n    ResultType = BoundaryResultTypeEnum.Locality,\n    Resolution = ResolutionEnum.Small,\n};\n\nResponse\u003CBoundary> result = client.GetPolygon(options);\n\nConsole.WriteLine($\"Boundary copyright: {result.Value.Properties?.Copyright}\");\nConsole.WriteLine($\"Polygon count: {result.Value.Geometry.Count}\");\n```\n\n### 5. Route Directions\n\n```csharp\nusing Azure;\nusing Azure.Core.GeoJson;\nusing Azure.Maps.Routing;\nusing Azure.Maps.Routing.Models;\n\nvar client = new MapsRoutingClient(new AzureKeyCredential(subscriptionKey));\n\nList\u003CGeoPosition> routePoints = new List\u003CGeoPosition>()\n{\n    new GeoPosition(-122.34, 47.61),  \u002F\u002F Seattle\n    new GeoPosition(-122.13, 47.64)   \u002F\u002F Redmond\n};\n\nRouteDirectionQuery query = new RouteDirectionQuery(routePoints);\nResponse\u003CRouteDirections> result = client.GetDirections(query);\n\nforeach (var route in result.Value.Routes)\n{\n    Console.WriteLine($\"Distance: {route.Summary.LengthInMeters} meters\");\n    Console.WriteLine($\"Duration: {route.Summary.TravelTimeDuration}\");\n    \n    foreach (RouteLeg leg in route.Legs)\n    {\n        Console.WriteLine($\"Leg points: {leg.Points.Count}\");\n    }\n}\n```\n\n### 6. Route Directions with Options\n\n```csharp\nRouteDirectionOptions options = new RouteDirectionOptions()\n{\n    RouteType = RouteType.Fastest,\n    UseTrafficData = true,\n    TravelMode = TravelMode.Bicycle,\n    Language = RoutingLanguage.EnglishUsa,\n    InstructionsType = RouteInstructionsType.Text,\n};\n\nRouteDirectionQuery query = new RouteDirectionQuery(routePoints)\n{\n    RouteDirectionOptions = options\n};\n\nResponse\u003CRouteDirections> result = client.GetDirections(query);\n```\n\n### 7. Route Matrix\n\n```csharp\nRouteMatrixQuery routeMatrixQuery = new RouteMatrixQuery\n{\n    Origins = new List\u003CGeoPosition>()\n    {\n        new GeoPosition(-122.34, 47.61),\n        new GeoPosition(-122.13, 47.64)\n    },\n    Destinations = new List\u003CGeoPosition>() \n    { \n        new GeoPosition(-122.20, 47.62),\n        new GeoPosition(-122.40, 47.65)\n    },\n};\n\n\u002F\u002F Synchronous (up to 100 route combinations)\nResponse\u003CRouteMatrixResult> result = client.GetImmediateRouteMatrix(routeMatrixQuery);\n\nforeach (var cell in result.Value.Matrix.SelectMany(row => row))\n{\n    Console.WriteLine($\"Distance: {cell.Response?.RouteSummary?.LengthInMeters}\");\n    Console.WriteLine($\"Duration: {cell.Response?.RouteSummary?.TravelTimeDuration}\");\n}\n\n\u002F\u002F Asynchronous (up to 700 route combinations)\nRouteMatrixOptions routeMatrixOptions = new RouteMatrixOptions(routeMatrixQuery)\n{\n    TravelTimeType = TravelTimeType.All,\n};\nGetRouteMatrixOperation asyncResult = client.GetRouteMatrix(WaitUntil.Completed, routeMatrixOptions);\n```\n\n### 8. Route Range (Isochrone)\n\n```csharp\nRouteRangeOptions options = new RouteRangeOptions(-122.34, 47.61)\n{\n    TimeBudget = new TimeSpan(0, 20, 0)  \u002F\u002F 20 minutes\n};\n\nResponse\u003CRouteRangeResult> result = client.GetRouteRange(options);\n\n\u002F\u002F result.Value.ReachableRange contains the polygon\nConsole.WriteLine($\"Boundary points: {result.Value.ReachableRange.Boundary.Count}\");\n```\n\n### 9. Get Map Tiles\n\n```csharp\nusing Azure;\nusing Azure.Maps.Rendering;\n\nvar client = new MapsRenderingClient(new AzureKeyCredential(subscriptionKey));\n\nint zoom = 10;\nint tileSize = 256;\n\n\u002F\u002F Convert coordinates to tile index\nMapTileIndex tileIndex = MapsRenderingClient.PositionToTileXY(\n    new GeoPosition(13.3854, 52.517), zoom, tileSize);\n\n\u002F\u002F Fetch map tile\nGetMapTileOptions options = new GetMapTileOptions(\n    MapTileSetId.MicrosoftImagery,\n    new MapTileIndex(tileIndex.X, tileIndex.Y, zoom)\n);\n\nResponse\u003CStream> mapTile = client.GetMapTile(options);\n\n\u002F\u002F Save to file\nusing (FileStream fileStream = File.Create(\".\u002FMapTile.png\"))\n{\n    mapTile.Value.CopyTo(fileStream);\n}\n```\n\n### 10. IP Geolocation\n\n```csharp\nusing System.Net;\nusing Azure;\nusing Azure.Maps.Geolocation;\n\nvar client = new MapsGeolocationClient(new AzureKeyCredential(subscriptionKey));\n\nIPAddress ipAddress = IPAddress.Parse(\"2001:4898:80e8:b::189\");\nResponse\u003CCountryRegionResult> result = client.GetCountryCode(ipAddress);\n\nConsole.WriteLine($\"Country ISO Code: {result.Value.IsoCode}\");\n```\n\n### 11. Current Weather\n\n```csharp\nusing Azure;\nusing Azure.Core.GeoJson;\nusing Azure.Maps.Weather;\n\nvar client = new MapsWeatherClient(new AzureKeyCredential(subscriptionKey));\n\nvar position = new GeoPosition(-122.13071, 47.64011);\nvar options = new GetCurrentWeatherConditionsOptions(position);\n\nResponse\u003CCurrentConditionsResult> result = client.GetCurrentWeatherConditions(options);\n\nforeach (var condition in result.Value.Results)\n{\n    Console.WriteLine($\"Temperature: {condition.Temperature.Value} {condition.Temperature.Unit}\");\n    Console.WriteLine($\"Weather: {condition.Phrase}\");\n    Console.WriteLine($\"Humidity: {condition.RelativeHumidity}%\");\n}\n```\n\n## Key Types Reference\n\n### Search Package\n\n| Type | Purpose |\n|------|---------|\n| `MapsSearchClient` | Main client for search operations |\n| `GeocodingResponse` | Geocoding result |\n| `GeocodingBatchResponse` | Batch geocoding result |\n| `GeocodingQuery` | Query for batch geocoding |\n| `ReverseGeocodingQuery` | Query for batch reverse geocoding |\n| `GetPolygonOptions` | Options for polygon retrieval |\n| `Boundary` | Boundary polygon result |\n| `BoundaryResultTypeEnum` | Boundary type (Locality, AdminDistrict, etc.) |\n| `ResolutionEnum` | Polygon resolution (Small, Medium, Large) |\n\n### Routing Package\n\n| Type | Purpose |\n|------|---------|\n| `MapsRoutingClient` | Main client for routing operations |\n| `RouteDirectionQuery` | Query for route directions |\n| `RouteDirectionOptions` | Route calculation options |\n| `RouteDirections` | Route directions result |\n| `RouteLeg` | Segment of a route |\n| `RouteMatrixQuery` | Query for route matrix |\n| `RouteMatrixResult` | Route matrix result |\n| `RouteRangeOptions` | Options for isochrone |\n| `RouteRangeResult` | Isochrone result |\n| `RouteType` | Route type (Fastest, Shortest, Eco, Thrilling) |\n| `TravelMode` | Travel mode (Car, Truck, Bicycle, Pedestrian) |\n\n### Rendering Package\n\n| Type | Purpose |\n|------|---------|\n| `MapsRenderingClient` | Main client for rendering |\n| `GetMapTileOptions` | Map tile options |\n| `MapTileIndex` | Tile coordinates (X, Y, Zoom) |\n| `MapTileSetId` | Tile set identifier |\n\n### Common Types\n\n| Type | Purpose |\n|------|---------|\n| `GeoPosition` | Geographic position (longitude, latitude) |\n| `GeoBoundingBox` | Bounding box for geographic area |\n\n## Best Practices\n\n1. **Use Entra ID for production** — Prefer over subscription keys\n2. **Batch operations** — Use batch geocoding for multiple addresses\n3. **Cache results** — Geocoding results don't change frequently\n4. **Use appropriate tile sizes** — 256 or 512 pixels based on display\n5. **Handle rate limits** — Implement exponential backoff\n6. **Use async route matrix** — For large matrix calculations (>100)\n7. **Consider traffic data** — Set `UseTrafficData = true` for accurate ETAs\n\n## Error Handling\n\n```csharp\ntry\n{\n    Response\u003CGeocodingResponse> result = client.GetGeocoding(address);\n}\ncatch (RequestFailedException ex)\n{\n    Console.WriteLine($\"Status: {ex.Status}\");\n    Console.WriteLine($\"Error: {ex.Message}\");\n    \n    switch (ex.Status)\n    {\n        case 400:\n            \u002F\u002F Invalid request parameters\n            break;\n        case 401:\n            \u002F\u002F Authentication failed\n            break;\n        case 429:\n            \u002F\u002F Rate limited - implement backoff\n            break;\n    }\n}\n```\n\n## Related SDKs\n\n| SDK | Purpose | Install |\n|-----|---------|---------|\n| `Azure.Maps.Search` | Geocoding, search | `dotnet add package Azure.Maps.Search --prerelease` |\n| `Azure.Maps.Routing` | Directions, matrix | `dotnet add package Azure.Maps.Routing --prerelease` |\n| `Azure.Maps.Rendering` | Map tiles, images | `dotnet add package Azure.Maps.Rendering --prerelease` |\n| `Azure.Maps.Geolocation` | IP geolocation | `dotnet add package Azure.Maps.Geolocation --prerelease` |\n| `Azure.Maps.Weather` | Weather data | `dotnet add package Azure.Maps.Weather --prerelease` |\n| `Azure.ResourceManager.Maps` | Account management | `dotnet add package Azure.ResourceManager.Maps --prerelease` |\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| Azure Maps Documentation | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fazure-maps\u002F |\n| Search API Reference | https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fazure.maps.search |\n| Routing API Reference | https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fazure.maps.routing |\n| GitHub Source | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-net\u002Ftree\u002Fmain\u002Fsdk\u002Fmaps |\n| Pricing | https:\u002F\u002Fazure.microsoft.com\u002Fpricing\u002Fdetails\u002Fazure-maps\u002F |\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,84,587,"2026-05-16 13:06:46",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"2c600459-37d1-4711-b9cb-b328b9ad5652","1.0.0","azure-maps-search-dotnet.zip",4703,"uploads\u002Fskills\u002F084435ad-3b2f-49f5-9b5b-00a77e3ba57d\u002Fazure-maps-search-dotnet.zip","3ce27a1823abdefdd986c9ff32899bf3e113303ddb8c503a29c473034cf844f0","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":15508}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]