1010
1111namespace SampleFunctions ;
1212
13- public class GetAzureMapsSaSToken ( )
13+ public class GetAzureMapsSaSToken
1414{
1515 private static readonly string [ ] AllowedDomains = [
1616 "https://samples.azuremaps.com/" ,
@@ -26,7 +26,7 @@ public class GetAzureMapsSaSToken()
2626 /// This tokenProvider will cache the token in memory, if you would like to reduce the dependency on Azure AD we recommend
2727 /// implementing a distributed cache combined with using the other methods available on tokenProvider.
2828 /// </remarks>
29- private readonly DefaultAzureCredential _TokenProvider = new ( new DefaultAzureCredentialOptions
29+ private readonly DefaultAzureCredential _tokenProvider = new ( new DefaultAzureCredentialOptions
3030 {
3131 TenantId = Environment . GetEnvironmentVariable ( "MAPS_SAS_TENANT_ID" ) ?? "" ,
3232 ExcludeInteractiveBrowserCredential = true ,
@@ -41,7 +41,7 @@ public IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] Http
4141 // Check if the referer header is present and if the domain is allowed
4242 if ( req . Headers . TryGetValue ( "Referer" , out var referer ) && AllowedDomains . Any ( domain => referer . ToString ( ) . StartsWith ( domain ) ) )
4343 {
44- armClient = new ArmClient ( _TokenProvider ) ;
44+ armClient = new ArmClient ( _tokenProvider ) ;
4545
4646 // Generate SAS token for Azure Maps
4747 string sasToken = GenerateAzureMapsSasToken ( armClient ) ;
@@ -57,7 +57,7 @@ public IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] Http
5757 /// Generates a Shared Access Signature (SAS) token for Azure Maps authentication.
5858 /// </summary>
5959 /// <param name="armClient">The ArmClient instance to use for authentication</param>
60- /// <param name="expiryInMinutes ">Token expiry time in seconds (default: 600)</param>
60+ /// <param name="expiryInSeconds ">Token expiry time in seconds (default: 600)</param>
6161 /// <param name="maxRatePerSecond">Maximum rate per second (default: 100)</param>
6262 /// <returns>The SAS token string</returns>
6363 private string GenerateAzureMapsSasToken ( ArmClient armClient , int expiryInSeconds = 600 , int maxRatePerSecond = 50 )
@@ -75,7 +75,7 @@ private string GenerateAzureMapsSasToken(ArmClient armClient, int expiryInSecond
7575 string principalId = Environment . GetEnvironmentVariable ( "AZURE_MAPS_PRINCIPAL_ID" ) ?? "" ;
7676
7777 // Set start and expiry time for the SAS token in round-trip date/time format
78- DateTime start = DateTime . Now ;
78+ DateTime start = DateTime . UtcNow ;
7979 DateTime expiry = start . AddSeconds ( expiryInSeconds ) ;
8080
8181 // Create the SAS token content
0 commit comments