Skip to content

Commit

Permalink
update env variable name and updated known issue section
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabh1007 committed Jul 8, 2024
1 parent b9041f6 commit 2a22d04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Microsoft.Azure.Cosmos/src/Telemetry/VmMetadataApiHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal static class VmMetadataApiHandler
private static AzureVMMetadata azMetadata = null;

/// <summary>
/// Check for environment variable COSMOS_DISABLE_VM_METADATA_ACCESS to decide if VM metadata call should be made or not.
/// Check for environment variable COSMOS_DISABLE_IMDS_ACCESS to decide if VM metadata call should be made or not.
/// If environment variable is set to true, then VM metadata call will not be made.
/// If environment variable is set to false, then VM metadata call will be made.
/// If environment variable is not set, then VM metadata call will be made.
Expand All @@ -45,7 +45,7 @@ internal static class VmMetadataApiHandler
internal static void TryInitialize(CosmosHttpClient httpClient)
{
bool isVMMetadataAccessDisabled =
ConfigurationManager.GetEnvironmentVariable<bool>("COSMOS_DISABLE_VM_METADATA_ACCESS", false);
ConfigurationManager.GetEnvironmentVariable<bool>("COSMOS_DISABLE_IMDS_ACCESS", false);
if (isVMMetadataAccessDisabled)
{
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ public void Initialize()
}

[TestMethod]
[DataRow("true", DisplayName = "When COSMOS_DISABLE_VM_METADATA_ACCESS is set as true, VM ID should not be fetched")]
[DataRow("false", DisplayName = "When COSMOS_DISABLE_VM_METADATA_ACCESS is set as false, VM ID should be fetched")]
[DataRow(null, DisplayName = "When COSMOS_DISABLE_VM_METADATA_ACCESS is NOT set, VM ID should be fetched")]
[DataRow("true", DisplayName = "When COSMOS_DISABLE_IMDS_ACCESS is set as true, VM ID should not be fetched")]
[DataRow("false", DisplayName = "When COSMOS_DISABLE_IMDS_ACCESS is set as false, VM ID should be fetched")]
[DataRow(null, DisplayName = "When COSMOS_DISABLE_IMDS_ACCESS is NOT set, VM ID should be fetched")]
public async Task GetVmIdAsMachineIdTest(string isVmMetadataAccessDisabled)
{
if (isVmMetadataAccessDisabled != null)
{
Environment.SetEnvironmentVariable("COSMOS_DISABLE_VM_METADATA_ACCESS", isVmMetadataAccessDisabled);
Environment.SetEnvironmentVariable("COSMOS_DISABLE_IMDS_ACCESS", isVmMetadataAccessDisabled);
}

try
Expand Down Expand Up @@ -84,7 +84,7 @@ static Task<HttpResponseMessage> sendFunc(HttpRequestMessage request, Cancellati
}
finally
{
Environment.SetEnvironmentVariable("COSMOS_DISABLE_VM_METADATA_ACCESS", null);
Environment.SetEnvironmentVariable("COSMOS_DISABLE_IMDS_ACCESS", null);
}
}

Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,7 @@ Below is a list of any know issues affecting the [recommended minimum version](#
| --- | --- | --- | --- |
| `FeedIterator` enters an infinite loop after a physical partition split occurs in a container using hierarchical partition keys. | Queries using prefix partition keys. | Rather than having the PK included in the query request options, filtering on top level hierarchical Pks should be done through where clauses. | [#4326](https://github.com/Azure/azure-cosmos-dotnet-v3/issues/4326) |
| Single partition queries (queries explicitly targetted to single partition or any queries on collection that had single physical partition) that resume using continuation token after partition split can observe failure on SDK v3.38 and beyond. | Explicit query exeuction using continuation token will fail query execution if these conditions are met. | Turn off Optimistic Direct Execution during query execution either by setting EnableOptimisticDirectExecution to false in query request options or by setting environment variable AZURE_COSMOS_OPTIMISTIC_DIRECT_EXECUTION_ENABLED to false. | [#4432](https://github.com/Azure/azure-cosmos-dotnet-v3/issues/4432) |
| An [Azure API](https://learn.microsoft.com/en-us/azure/virtual-machines/instance-metadata-service?tabs=linux) call is made to get the VM information. This call fails if cutomer is on non-Azure VM. | Although this call is made only during once during client initialization but this failure would come up into monitoring tool which leads to a confusion.| Turn off this call by setting environment variable COSMOS_DISABLE_IMDS_ACCESS to false. |[#4187](https://github.com/Azure/azure-cosmos-dotnet-v3/issues/4187) |

## Release & Retirement dates

Expand Down

0 comments on commit 2a22d04

Please sign in to comment.