diff --git a/src/azure-cli/azure/cli/command_modules/appconfig/_utils.py b/src/azure-cli/azure/cli/command_modules/appconfig/_utils.py index 4985ec556c6..ee773cfccbb 100644 --- a/src/azure-cli/azure/cli/command_modules/appconfig/_utils.py +++ b/src/azure-cli/azure/cli/command_modules/appconfig/_utils.py @@ -212,6 +212,8 @@ def get_appconfig_data_client(cmd, name, connection_string, auth_mode, endpoint) token_audience = None if hasattr(current_cloud.endpoints, "appconfig_auth_token_audience"): token_audience = current_cloud.endpoints.appconfig_auth_token_audience + else: + token_audience = endpoint try: azconfig_client = AzureAppConfigurationClient(credential=AppConfigurationCliCredential(cred, token_audience), diff --git a/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_snapshot_mgmt.yaml b/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_snapshot_mgmt.yaml index d21e57b727e..32b17d88acb 100644 --- a/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_snapshot_mgmt.yaml +++ b/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_snapshot_mgmt.yaml @@ -6,7 +6,7 @@ interactions: Accept: - application/json Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -69,7 +69,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -121,7 +121,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -173,7 +173,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -225,7 +225,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -277,7 +277,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -336,7 +336,7 @@ interactions: Accept: - application/json Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig credential list Connection: @@ -917,6 +917,33 @@ interactions: "lastModifiedBy": "test@example.com", "lastModifiedByType": "User", "lastModifiedAt": "2026-02-03T17:44:56+00:00"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.AppConfiguration/configurationStores/jiyu-devsku", "name": "jiyu-devsku", "tags": {}}, {"type": "Microsoft.AppConfiguration/configurationStores", + "location": "westus", "identity": {"type": "SystemAssigned", "principalId": + "728636b7-511b-4337-b4a5-bcceafed09ad", "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"}, + "properties": {"provisioningState": "Succeeded", "creationDate": "2026-05-12T11:18:20+00:00", + "endpoint": "https://jiyu-nsp-create-2.azconfig.io", "encryption": {"keyVaultProperties": + null}, "privateEndpointConnections": null, "publicNetworkAccess": "Disabled", + "disableLocalAuth": true, "softDeleteRetentionInDays": 7, "defaultKeyValueRevisionRetentionPeriodInSeconds": + 2592000, "enablePurgeProtection": false, "dataPlaneProxy": {"authenticationMode": + "Pass-through", "privateLinkDelegation": "Disabled"}, "telemetry": {"resourceId": + null}, "managedOnBehalfOfConfiguration": null, "azureFrontDoor": {"resourceId": + null}}, "sku": {"name": "standard"}, "systemData": {"createdBy": "test@example.com", + "createdByType": "User", "createdAt": "2026-05-12T11:18:20+00:00", "lastModifiedBy": + "test@example.com", "lastModifiedByType": "User", "lastModifiedAt": "2026-05-15T01:05:53+00:00"}, + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.AppConfiguration/configurationStores/jiyu-nsp-create-2", + "name": "jiyu-nsp-create-2", "tags": {}}, {"type": "Microsoft.AppConfiguration/configurationStores", + "location": "westus", "properties": {"provisioningState": "Succeeded", "creationDate": + "2026-05-12T11:15:58+00:00", "endpoint": "https://jiyu-nsp-create2.azconfig.io", + "encryption": {"keyVaultProperties": null}, "privateEndpointConnections": + null, "publicNetworkAccess": "SecuredByPerimeter", "disableLocalAuth": true, + "softDeleteRetentionInDays": 7, "defaultKeyValueRevisionRetentionPeriodInSeconds": + 2592000, "enablePurgeProtection": false, "dataPlaneProxy": {"authenticationMode": + "Pass-through", "privateLinkDelegation": "Disabled"}, "telemetry": {"resourceId": + null}, "managedOnBehalfOfConfiguration": null, "azureFrontDoor": {"resourceId": + null}}, "sku": {"name": "standard"}, "systemData": {"createdBy": "test@example.com", + "createdByType": "User", "createdAt": "2026-05-12T11:15:58+00:00", "lastModifiedBy": + "test@example.com", "lastModifiedByType": "User", "lastModifiedAt": "2026-05-12T11:15:58+00:00"}, + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.AppConfiguration/configurationStores/jiyu-nsp-create2", + "name": "jiyu-nsp-create2", "tags": {}}, {"type": "Microsoft.AppConfiguration/configurationStores", "location": "westus", "identity": {"type": "SystemAssigned, UserAssigned", "userAssignedIdentities": {"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/jiyu/providers/microsoft.managedidentity/userassignedidentities/jiyu-useridentity-1": {"principalId": "634a239c-d987-4892-83a4-5a4c987e3606", "clientId": "2e0d90a5-7909-4831-8508-31cbc111cb52"}}, @@ -955,6 +982,22 @@ interactions: "2025-05-08T22:49:58+00:00", "lastModifiedBy": "test@example.com", "lastModifiedByType": "User", "lastModifiedAt": "2025-05-08T22:49:58+00:00"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.AppConfiguration/configurationStores/jiyu-test-create", "name": "jiyu-test-create", "tags": {}}, {"type": "Microsoft.AppConfiguration/configurationStores", + "location": "westus", "identity": {"type": "UserAssigned", "userAssignedIdentities": + {"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.ManagedIdentity/userAssignedIdentities/jiyu-id-test": + {"principalId": "cf7f0571-ee04-4e37-8e8d-51c2c6debf21", "clientId": "6efd7a73-2f91-49b1-a2d3-f1fda4e731b1"}}}, + "properties": {"provisioningState": "Succeeded", "creationDate": "2026-05-14T22:28:57+00:00", + "endpoint": "https://jiyu-test-store.azconfig.io", "encryption": {"keyVaultProperties": + {"keyIdentifier": "https://jiyu-keyvault-2.vault.azure.net/keys/key2", "identityClientId": + "6efd7a73-2f91-49b1-a2d3-f1fda4e731b1"}}, "privateEndpointConnections": null, + "publicNetworkAccess": "SecuredByPerimeter", "disableLocalAuth": true, "softDeleteRetentionInDays": + 7, "defaultKeyValueRevisionRetentionPeriodInSeconds": 2592000, "enablePurgeProtection": + false, "dataPlaneProxy": {"authenticationMode": "Pass-through", "privateLinkDelegation": + "Disabled"}, "telemetry": {"resourceId": null}, "managedOnBehalfOfConfiguration": + null, "azureFrontDoor": {"resourceId": null}}, "sku": {"name": "standard"}, + "systemData": {"createdBy": "test@example.com", "createdByType": "User", "createdAt": + "2026-05-14T22:28:57+00:00", "lastModifiedBy": "test@example.com", "lastModifiedByType": + "User", "lastModifiedAt": "2026-05-14T23:50:00+00:00"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.AppConfiguration/configurationStores/jiyu-test-store", + "name": "jiyu-test-store", "tags": {}}, {"type": "Microsoft.AppConfiguration/configurationStores", "location": "westus", "properties": {"provisioningState": "Succeeded", "creationDate": "2019-10-03T00:48:41+00:00", "endpoint": "https://jiyu-test1.azconfig.io", "encryption": {"keyVaultProperties": null}, "privateEndpointConnections": @@ -995,7 +1038,7 @@ interactions: "da9f840f-a366-4525-ae77-7142a794cf49", "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"}, "properties": {"provisioningState": "Succeeded", "creationDate": "2023-03-16T23:19:49+00:00", "endpoint": "https://jiyu-teststore.azconfig.io", "encryption": {"keyVaultProperties": - null}, "privateEndpointConnections": null, "publicNetworkAccess": "SecuredByPerimeter", + null}, "privateEndpointConnections": null, "publicNetworkAccess": "Disabled", "disableLocalAuth": false, "softDeleteRetentionInDays": 7, "defaultKeyValueRevisionRetentionPeriodInSeconds": 2592000, "enablePurgeProtection": false, "dataPlaneProxy": {"authenticationMode": "Local", "privateLinkDelegation": "Disabled"}, "telemetry": {"resourceId": @@ -4400,7 +4443,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig credential list Connection: @@ -7639,7 +7682,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig credential list Connection: @@ -7687,7 +7730,7 @@ interactions: Accept: - application/json Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig credential list Connection: @@ -7750,7 +7793,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -7790,7 +7833,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -7843,7 +7886,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -7883,7 +7926,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -7936,7 +7979,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -7976,7 +8019,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -8030,7 +8073,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -8083,7 +8126,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Sync-Token: @@ -8127,7 +8170,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Sync-Token: @@ -8171,7 +8214,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Sync-Token: @@ -8220,7 +8263,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -8267,7 +8310,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -8308,7 +8351,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -8359,7 +8402,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -8400,7 +8443,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -8451,7 +8494,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -8492,7 +8535,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -8535,7 +8578,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -8578,7 +8621,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Sync-Token: @@ -8620,7 +8663,7 @@ interactions: Accept: - application/json Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -8683,7 +8726,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -8735,7 +8778,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -8787,7 +8830,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -8839,7 +8882,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -8891,7 +8934,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig create Connection: @@ -8950,7 +8993,7 @@ interactions: Accept: - application/json Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig credential list Connection: @@ -9531,6 +9574,33 @@ interactions: "lastModifiedBy": "test@example.com", "lastModifiedByType": "User", "lastModifiedAt": "2026-02-03T17:44:56+00:00"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.AppConfiguration/configurationStores/jiyu-devsku", "name": "jiyu-devsku", "tags": {}}, {"type": "Microsoft.AppConfiguration/configurationStores", + "location": "westus", "identity": {"type": "SystemAssigned", "principalId": + "728636b7-511b-4337-b4a5-bcceafed09ad", "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"}, + "properties": {"provisioningState": "Succeeded", "creationDate": "2026-05-12T11:18:20+00:00", + "endpoint": "https://jiyu-nsp-create-2.azconfig.io", "encryption": {"keyVaultProperties": + null}, "privateEndpointConnections": null, "publicNetworkAccess": "Disabled", + "disableLocalAuth": true, "softDeleteRetentionInDays": 7, "defaultKeyValueRevisionRetentionPeriodInSeconds": + 2592000, "enablePurgeProtection": false, "dataPlaneProxy": {"authenticationMode": + "Pass-through", "privateLinkDelegation": "Disabled"}, "telemetry": {"resourceId": + null}, "managedOnBehalfOfConfiguration": null, "azureFrontDoor": {"resourceId": + null}}, "sku": {"name": "standard"}, "systemData": {"createdBy": "test@example.com", + "createdByType": "User", "createdAt": "2026-05-12T11:18:20+00:00", "lastModifiedBy": + "test@example.com", "lastModifiedByType": "User", "lastModifiedAt": "2026-05-15T01:05:53+00:00"}, + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.AppConfiguration/configurationStores/jiyu-nsp-create-2", + "name": "jiyu-nsp-create-2", "tags": {}}, {"type": "Microsoft.AppConfiguration/configurationStores", + "location": "westus", "properties": {"provisioningState": "Succeeded", "creationDate": + "2026-05-12T11:15:58+00:00", "endpoint": "https://jiyu-nsp-create2.azconfig.io", + "encryption": {"keyVaultProperties": null}, "privateEndpointConnections": + null, "publicNetworkAccess": "SecuredByPerimeter", "disableLocalAuth": true, + "softDeleteRetentionInDays": 7, "defaultKeyValueRevisionRetentionPeriodInSeconds": + 2592000, "enablePurgeProtection": false, "dataPlaneProxy": {"authenticationMode": + "Pass-through", "privateLinkDelegation": "Disabled"}, "telemetry": {"resourceId": + null}, "managedOnBehalfOfConfiguration": null, "azureFrontDoor": {"resourceId": + null}}, "sku": {"name": "standard"}, "systemData": {"createdBy": "test@example.com", + "createdByType": "User", "createdAt": "2026-05-12T11:15:58+00:00", "lastModifiedBy": + "test@example.com", "lastModifiedByType": "User", "lastModifiedAt": "2026-05-12T11:15:58+00:00"}, + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.AppConfiguration/configurationStores/jiyu-nsp-create2", + "name": "jiyu-nsp-create2", "tags": {}}, {"type": "Microsoft.AppConfiguration/configurationStores", "location": "westus", "identity": {"type": "SystemAssigned, UserAssigned", "userAssignedIdentities": {"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/jiyu/providers/microsoft.managedidentity/userassignedidentities/jiyu-useridentity-1": {"principalId": "634a239c-d987-4892-83a4-5a4c987e3606", "clientId": "2e0d90a5-7909-4831-8508-31cbc111cb52"}}, @@ -9569,6 +9639,22 @@ interactions: "2025-05-08T22:49:58+00:00", "lastModifiedBy": "test@example.com", "lastModifiedByType": "User", "lastModifiedAt": "2025-05-08T22:49:58+00:00"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.AppConfiguration/configurationStores/jiyu-test-create", "name": "jiyu-test-create", "tags": {}}, {"type": "Microsoft.AppConfiguration/configurationStores", + "location": "westus", "identity": {"type": "UserAssigned", "userAssignedIdentities": + {"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.ManagedIdentity/userAssignedIdentities/jiyu-id-test": + {"principalId": "cf7f0571-ee04-4e37-8e8d-51c2c6debf21", "clientId": "6efd7a73-2f91-49b1-a2d3-f1fda4e731b1"}}}, + "properties": {"provisioningState": "Succeeded", "creationDate": "2026-05-14T22:28:57+00:00", + "endpoint": "https://jiyu-test-store.azconfig.io", "encryption": {"keyVaultProperties": + {"keyIdentifier": "https://jiyu-keyvault-2.vault.azure.net/keys/key2", "identityClientId": + "6efd7a73-2f91-49b1-a2d3-f1fda4e731b1"}}, "privateEndpointConnections": null, + "publicNetworkAccess": "SecuredByPerimeter", "disableLocalAuth": true, "softDeleteRetentionInDays": + 7, "defaultKeyValueRevisionRetentionPeriodInSeconds": 2592000, "enablePurgeProtection": + false, "dataPlaneProxy": {"authenticationMode": "Pass-through", "privateLinkDelegation": + "Disabled"}, "telemetry": {"resourceId": null}, "managedOnBehalfOfConfiguration": + null, "azureFrontDoor": {"resourceId": null}}, "sku": {"name": "standard"}, + "systemData": {"createdBy": "test@example.com", "createdByType": "User", "createdAt": + "2026-05-14T22:28:57+00:00", "lastModifiedBy": "test@example.com", "lastModifiedByType": + "User", "lastModifiedAt": "2026-05-14T23:50:00+00:00"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jiyu/providers/Microsoft.AppConfiguration/configurationStores/jiyu-test-store", + "name": "jiyu-test-store", "tags": {}}, {"type": "Microsoft.AppConfiguration/configurationStores", "location": "westus", "properties": {"provisioningState": "Succeeded", "creationDate": "2019-10-03T00:48:41+00:00", "endpoint": "https://jiyu-test1.azconfig.io", "encryption": {"keyVaultProperties": null}, "privateEndpointConnections": @@ -9609,7 +9695,7 @@ interactions: "da9f840f-a366-4525-ae77-7142a794cf49", "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"}, "properties": {"provisioningState": "Succeeded", "creationDate": "2023-03-16T23:19:49+00:00", "endpoint": "https://jiyu-teststore.azconfig.io", "encryption": {"keyVaultProperties": - null}, "privateEndpointConnections": null, "publicNetworkAccess": "SecuredByPerimeter", + null}, "privateEndpointConnections": null, "publicNetworkAccess": "Disabled", "disableLocalAuth": false, "softDeleteRetentionInDays": 7, "defaultKeyValueRevisionRetentionPeriodInSeconds": 2592000, "enablePurgeProtection": false, "dataPlaneProxy": {"authenticationMode": "Local", "privateLinkDelegation": "Disabled"}, "telemetry": {"resourceId": @@ -13025,7 +13111,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig credential list Connection: @@ -16264,7 +16350,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig credential list Connection: @@ -16312,7 +16398,7 @@ interactions: Accept: - application/json Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd CommandName: - appconfig credential list Connection: @@ -16375,7 +16461,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -16418,7 +16504,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -16461,7 +16547,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -16505,7 +16591,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -16557,7 +16643,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -16608,7 +16694,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -16651,7 +16737,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -16694,7 +16780,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -16745,7 +16831,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -16796,7 +16882,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -16839,7 +16925,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: @@ -16883,7 +16969,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -16935,7 +17021,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive Content-Length: @@ -16986,7 +17072,7 @@ interactions: Accept: - '*/*' Accept-Encoding: - - gzip, deflate + - gzip, deflate, zstd Connection: - keep-alive User-Agent: diff --git a/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_aad_auth.py b/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_aad_auth.py index dec416ac3aa..41a79743d4e 100644 --- a/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_aad_auth.py +++ b/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_aad_auth.py @@ -9,6 +9,7 @@ import os import time import unittest +from types import SimpleNamespace from azure.cli.command_modules.appconfig._credential import AppConfigurationCliCredential from azure.cli.command_modules.appconfig._utils import get_appconfig_data_client @@ -60,6 +61,40 @@ def mock_get_active_cloud(cli_ctx=None): cloud.endpoints.appconfig_auth_token_audience = APPCONFIG_AUTH_TOKEN_AUDIENCE return cloud + +class AppConfigAadAuthUnitTest(unittest.TestCase): + + @mock.patch('azure.cli.command_modules.appconfig._utils.AzureAppConfigurationClient') + @mock.patch('azure.cli.command_modules.appconfig._credential.AppConfigurationCliCredential') + @mock.patch('azure.cli.core.cloud.get_active_cloud') + @mock.patch('azure.cli.core._profile.Profile') + def test_get_appconfig_data_client_falls_back_to_endpoint_when_cloud_has_no_audience( + self, + profile_cls_mock, + get_active_cloud_mock, + appconfig_credential_cls_mock, + appconfig_client_cls_mock): + endpoint = 'https://contoso.azconfig.io' + command = mock.MagicMock() + command.cli_ctx = DummyCli() + + token_credential = object() + profile_cls_mock.return_value.get_login_credentials.return_value = (token_credential, None, None) + get_active_cloud_mock.return_value = SimpleNamespace(endpoints=SimpleNamespace()) + + get_appconfig_data_client( + command, + name=None, + connection_string=None, + auth_mode='login', + endpoint=endpoint) + + appconfig_credential_cls_mock.assert_called_once_with(token_credential, endpoint) + appconfig_client_cls_mock.assert_called_once_with( + credential=appconfig_credential_cls_mock.return_value, + base_url=endpoint, + user_agent=mock.ANY) + class AppConfigAadAuthLiveScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): @@ -318,8 +353,8 @@ def test_azconfig_user_token_audience(self, resource_group, location): if "Operation returned an invalid status 'Forbidden'" not in str(e): raise e - # Assert that the ClientCredential was instantiated with no custom scope - cred_mock.assert_called_with(mock.ANY, None) + # Assert that AppConfigurationCliCredential was instantiated with endpoint as the token audience + cred_mock.assert_called_with(mock.ANY, endpoint) # Mock the get_active_cloud function to return a custom cloud with a custom token audience with mock.patch('azure.cli.core.cloud.get_active_cloud', new=mock_get_active_cloud): @@ -332,5 +367,5 @@ def test_azconfig_user_token_audience(self, resource_group, location): if "Operation returned an invalid status 'Forbidden'" not in str(e): raise e - # Assert that the ClientCredential was instantiated with the correct scope + # Assert that AppConfigurationCliCredential was instantiated with the configured audience cred_mock.assert_called_with(mock.ANY, APPCONFIG_AUTH_TOKEN_AUDIENCE) diff --git a/src/azure-cli/requirements.py3.Darwin.txt b/src/azure-cli/requirements.py3.Darwin.txt index 55aaa3579bd..7f5e73b1b5a 100644 --- a/src/azure-cli/requirements.py3.Darwin.txt +++ b/src/azure-cli/requirements.py3.Darwin.txt @@ -2,7 +2,7 @@ antlr4-python3-runtime==4.13.1 applicationinsights==0.11.9 argcomplete==3.5.2 asn1crypto==0.24.0 -azure-appconfiguration==1.7.2 +azure-appconfiguration==1.8.0 azure-batch==15.0.0b1 azure-cli-core==2.86.0 azure-cli-telemetry==1.1.0 diff --git a/src/azure-cli/requirements.py3.Linux.txt b/src/azure-cli/requirements.py3.Linux.txt index a4d6a0905ea..6a154a9f602 100644 --- a/src/azure-cli/requirements.py3.Linux.txt +++ b/src/azure-cli/requirements.py3.Linux.txt @@ -2,7 +2,7 @@ antlr4-python3-runtime==4.13.1 applicationinsights==0.11.9 argcomplete==3.5.2 asn1crypto==0.24.0 -azure-appconfiguration==1.7.2 +azure-appconfiguration==1.8.0 azure-batch==15.0.0b1 azure-cli-core==2.86.0 azure-cli-telemetry==1.1.0 diff --git a/src/azure-cli/requirements.py3.windows.txt b/src/azure-cli/requirements.py3.windows.txt index c5fd5f4b15e..5bf0a8c6c2f 100644 --- a/src/azure-cli/requirements.py3.windows.txt +++ b/src/azure-cli/requirements.py3.windows.txt @@ -2,7 +2,7 @@ antlr4-python3-runtime==4.13.1 applicationinsights==0.11.9 argcomplete==3.5.2 asn1crypto==0.24.0 -azure-appconfiguration==1.7.2 +azure-appconfiguration==1.8.0 azure-batch==15.0.0b1 azure-cli-core==2.86.0 azure-cli-telemetry==1.1.0 diff --git a/src/azure-cli/setup.py b/src/azure-cli/setup.py index bd5c0d6b13d..b512612849b 100644 --- a/src/azure-cli/setup.py +++ b/src/azure-cli/setup.py @@ -51,7 +51,7 @@ DEPENDENCIES = [ "antlr4-python3-runtime~=4.13.1", - 'azure-appconfiguration~=1.7.2', + 'azure-appconfiguration~=1.8.0', 'azure-ai-projects~=1.0.0', 'azure-batch==15.0.0b1', 'azure-cli-core=={}'.format(VERSION),