From b3d05dc6f177d8956efab09507efc35e8d4ce31a Mon Sep 17 00:00:00 2001 From: David Federman Date: Thu, 10 Oct 2024 10:28:31 -0700 Subject: [PATCH] Fix error message when MI client id is missing (#90) --- README.md | 2 +- src/AzureBlobStorage/MSBuildCacheAzureBlobStoragePlugin.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3771612..afc1e83 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ These settings are available in addition to the [Common Settings](#common-settin | `$(MSBuildCacheCredentialsType)` | `string` | "Interactive" | Indicates the credential type to use for authentication. Valid values are "Interactive", "ConnectionString", "ManagedIdentity" | | `$(MSBuildCacheBlobUri)` | `Uri` | | Specifies the uri of the Azure Storage Blob. | | `$(MSBuildCacheManagedIdentityClientId)` | `string` | | Specifies the managed identity client id when using the "ManagedIdentity" credential type | -| `$(MSBuildCacheInteractiveAuthTokenDirectory)` | `string` | "%LOCALAPPDATA%\MSBuildCache\AuthTokenCache" | Specifies a token cache directory when using the "ManagedIdentity" credential type | +| `$(MSBuildCacheInteractiveAuthTokenDirectory)` | `string` | "%LOCALAPPDATA%\MSBuildCache\AuthTokenCache" | Specifies a token cache directory when using the "Interactive" credential type | When using the "ConnectionString" credential type, the connection string to the blob storage account must be provided in the `MSBUILDCACHE_CONNECTIONSTRING` environment variable. This connection string needs both read and write access to the resource. diff --git a/src/AzureBlobStorage/MSBuildCacheAzureBlobStoragePlugin.cs b/src/AzureBlobStorage/MSBuildCacheAzureBlobStoragePlugin.cs index 3fbc3ef..e8f59cc 100644 --- a/src/AzureBlobStorage/MSBuildCacheAzureBlobStoragePlugin.cs +++ b/src/AzureBlobStorage/MSBuildCacheAzureBlobStoragePlugin.cs @@ -133,7 +133,7 @@ private static IAzureStorageCredentials CreateAzureStorageCredentials(AzureBlobS if (string.IsNullOrEmpty(settings.ManagedIdentityClientId)) { - throw new InvalidOperationException($"{nameof(AzureBlobStoragePluginSettings.BlobUri)} is required when using {nameof(AzureBlobStoragePluginSettings.CredentialsType)}={settings.CredentialsType}"); + throw new InvalidOperationException($"{nameof(AzureBlobStoragePluginSettings.ManagedIdentityClientId)} is required when using {nameof(AzureBlobStoragePluginSettings.CredentialsType)}={settings.CredentialsType}"); } return new ManagedIdentityAzureStorageCredentials(settings.ManagedIdentityClientId!, settings.BlobUri);