Skip to content

Commit d95eea9

Browse files
authored
Refactor Request Exception to move Exception Generation string to new function (#499)
* Update CHANGELOG, add Get-CosmosDbRequestExceptionString function, and refactor Invoke-CosmosDbRequest; update CI pipeline for MacOS-13 * Refactor error handling in unit tests for Get-CosmosDbRequestExceptionString to use ErrorRecord objects * Enhance Get-CosmosDbRequestExceptionString function to handle null response scenarios and update unit tests for improved clarity and coverage * Refactor Azure Pipelines configuration to consolidate unit and integration test jobs into matrices for improved maintainability and scalability * Update Azure Pipelines configuration to enable PowerShell execution for unit and integration tests on specific environments * Update CHANGELOG and improve Get-CosmosDbRequestExceptionString function and tests for better error handling * Update README and Azure Pipelines configuration to add support for Windows Server 2025 and Ubuntu 24.04 * Add support for macOS 14 and macOS 15 in Azure Pipelines configuration and README * Update README and Azure Pipelines configuration to include Windows Server 2025 support and PowerShell 7.x test matrices * Update CHANGELOG to reflect added testing for macOS and Windows Server in CI pipeline * Fix spelling errors in CI pipeline configuration and update CHANGELOG * Fix typos in README for clarity and accuracy
1 parent e02bbee commit d95eea9

File tree

7 files changed

+357
-352
lines changed

7 files changed

+357
-352
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Added `Get-CosmosDbRequestExceptionString` function to get the exception string
13+
from a Cosmos DB response. Refactored `Invoke-CosmosDbRequest` to use this
14+
function to get the exception string from the response.
15+
- Added testing for MacOS-13, MacOS-14, MacOS-15, Windows Server 2025, Ubuntu-24.04
16+
and PowerShell 7.x on Windows Server 2019, 2022 and 2025 to the CI pipeline.
17+
18+
### Fixed
19+
20+
- Converted CI pipeline Test stage to use matrix to reduce duplication of code.
21+
- FIx spelling error of `ApplicationObjectId` variable in CI pipeline.
22+
1023
## [5.1.0] - 2024-12-15
1124

1225
### Fixed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ object using the `New-CosmosDbContext` cmdlet which you can then
125125
use to pass to the other Cosmos DB cmdlets in the module.
126126

127127
To create the context object you will either need access to the
128-
primary primary or secondary keys from your Cosmos DB account or allow
128+
primary or secondary keys from your Cosmos DB account or allow
129129
the _CosmosDB Powershell module_ to retrieve the keys directly from
130130
the Azure management portal for you.
131131

@@ -144,7 +144,7 @@ that will be used to authenticate requests to Cosmos DB.
144144
To create a context object using an _Entra ID Authorization Token_ you will need
145145
to set the `EntraIdToken` parameter to the token you have retrieved from Entra ID
146146
for the identity that you have given appropriate permissions to the `account`,
147-
`database` and/or `collection`. See [this page](https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-setup-rbac#concepts) for more infomration.
147+
`database` and/or `collection`. See [this page](https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-setup-rbac#concepts) for more information.
148148

149149
```powershell
150150
# Get an OAuth2 resource token from Entra ID for the Cosmos DB account.
@@ -463,7 +463,7 @@ New-CosmosDbCollection -Context $cosmosDbContext -Id MyNewCollection -PartitionK
463463
```
464464

465465
Create a collection in the database with the partition key 'id' using
466-
autoscaling with the maximum throughput of 40,000 RU/s and a mimimum of
466+
autoscaling with the maximum throughput of 40,000 RU/s and a minimum of
467467
4,000 RU/s:
468468

469469
```powershell
@@ -1250,12 +1250,19 @@ on the following systems:
12501250
- Windows Server (using Windows PowerShell 5.1):
12511251
- Windows Server 2019: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
12521252
- Windows Server 2022: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
1253+
- Windows Server 2025: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
1254+
- Windows Server (using Windows PowerShell 7.x):
1255+
- Windows Server 2019: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
1256+
- Windows Server 2022: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
1257+
- Windows Server 2025: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
12531258
- Linux (using PowerShell 7.x):
12541259
- Ubuntu 20.04: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
12551260
- Ubuntu 22.04: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
1256-
- macOS (using PowerShell Core 6.x - to be changed to in future 7.x):
1257-
- macOS 11: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
1258-
- macOS 12: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
1261+
- Ubuntu 24.04: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
1262+
- macOS (using PowerShell 7.x):
1263+
- macOS 13: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
1264+
- macOS 14: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
1265+
- macOS 15: Using [Azure Pipelines](https://dev.azure.com/dscottraynsford/GitHub/_build?definitionId=4).
12591266

12601267
> This module is no longer tested on PowerShell Core 6.x as PowerShell 7.x
12611268
> should be used. It should still work, but will no longer be verified. Issues with

0 commit comments

Comments
 (0)