Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianHayward committed Feb 6, 2024
1 parent 39ff726 commit 492f55a
Show file tree
Hide file tree
Showing 12 changed files with 265 additions and 152 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ Write-Host 'here is the token:' $azAPICallConf['htBearerAccessToken'].Storage

## Supported endpoints

| Endpoint | Endpoint URL (AzureCloud) | Variable |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| [Microsoft Graph](https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0) | `https://graph.microsoft.com` | `$azAPICallConf['azAPIEndpointUrls'].MicrosoftGraph` |
| [ARM (Azure Resource Management)](https://docs.microsoft.com/en-us/rest/api/resources/) | `https://management.azure.com`<br>(or regional: `https://westus.management.azure.com`) | `$azAPICallConf['azAPIEndpointUrls'].ARM`<br>(or regional: `$azAPICallConf['azAPIEndpointUrls'].ARMwestus`) |
| [Azure Key Vault](https://docs.microsoft.com/en-us/rest/api/keyvault/) | `https://vault.azure.net` | `$azAPICallConf['azAPIEndpointUrls'].KeyVault` |
| [Log Analytics](https://docs.microsoft.com/en-us/rest/api/loganalytics/) | `https://api.loganalytics.io/v1` | `$azAPICallConf['azAPIEndpointUrls'].LogAnalytics` |
| [Storage (blob)](https://learn.microsoft.com/en-us/rest/api/storageservices/) | `https://<storageAccountName>.blob.core.windows.net` / `https://<storageAccountName>.blob.storage.azure.net` | https://_storageAccountName_.blob.core.windows.net / https://_storageAccountName_.blob.storage.azure.net |
| Endpoint | Endpoint URL (AzureCloud) | Variable |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| [Microsoft Graph](https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0) | `https://graph.microsoft.com` | `$azAPICallConf['azAPIEndpointUrls'].MicrosoftGraph` |
| [ARM (Azure Resource Management)](https://docs.microsoft.com/en-us/rest/api/resources/) | `https://management.azure.com`<br>(or regional: `https://westus.management.azure.com`) | `$azAPICallConf['azAPIEndpointUrls'].ARM`<br>(or regional: `$azAPICallConf['azAPIEndpointUrls'].ARMwestus`) |
| [Azure Key Vault](https://docs.microsoft.com/en-us/rest/api/keyvault/) | `https://vault.azure.net` | `$azAPICallConf['azAPIEndpointUrls'].KeyVault` |
| [Log Analytics](https://docs.microsoft.com/en-us/rest/api/loganalytics/) | `https://api.loganalytics.io/v1` | `$azAPICallConf['azAPIEndpointUrls'].LogAnalytics` |
| [Storage (blob)](https://learn.microsoft.com/en-us/rest/api/storageservices/) | `https://<storageAccountName>.blob.core.windows.net` / `https://<storageAccountName>.blob.storage.azure.net` | https://_storageAccountName_.blob.core.windows.net / https://_storageAccountName_.blob.storage.azure.net |
| [Monitor (ingest)](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/logs-ingestion-api-overview#rest-api-call) | `https://<dce-endpoint>.ingest.monitor.azure.com` | https://_dceEndpoint_```$($azAPICallConf['azAPIEndpointUrls'].MonitorIngest)``` |

Add a new endpoint -> setAzureEnvironment.ps1

Expand Down Expand Up @@ -136,7 +137,7 @@ Example: `AzAPICall -uri "https://management.azure.com/subscriptions?api-version
| body | `string` | Request Body for the API request - [Example](https://docs.microsoft.com/en-us/graph/api/group-post-owners?view=graph-rest-1.0&tabs=http#request-body) | |
| caller | `string` | Set the value to `CustomDataCollection` for parallelization to have different font colors for the debug output | |
| consistencyLevel | `string` | For several [OData query parameters](https://docs.microsoft.com/en-us/graph/query-parameters) the `consistencyLevel`-header need to be set to `eventual` | |
| listenOn | `string` | Depending to the expected response of the API call the following values are accepted: `Value`, `Content`, `ContentProperties`, `Headers`, `StatusCode` or `Raw`. &#128161; An example for the ARM Subscriptions API: To get _one_ defined subscription you would use `-listenOn Content`, for get/list _all_ subscriptions you would use no `-listenOn`-parameter as the default `listenOn`-value would be `Value`. Think [singular/plural](#example-for-azure-resource-manager) | default is `Value` |
| listenOn | `string` | Depending to the expected response of the API call the following values are accepted: `Value`, `Content`, `ContentProperties`, `Headers`, `StatusCode` or `Raw`. &#128161; An example for the ARM Subscriptions API: To get _one_ defined subscription you would use `-listenOn Content`, for get/list _all_ subscriptions you would use no `-listenOn`-parameter as the default `listenOn`-value would be `Value`. Think [singular/plural](#example-for-azure-resource-manager) | default is `Value` |
| noPaging | `switch` | If value is `true` paging will be deactivated and you will only get the defined number of `$top` results or [Resource Graph limits any query to returning only `100` records](https://docs.microsoft.com/en-us/azure/governance/resource-graph/concepts/work-with-data). Otherwise, you can use `$top` to increase the result batches from default `100` up to `999` for the `AzAPICall`. Value for `$top` must range from 1 to 999 | |
| validateAccess | `switch` | Use this parameter if you only want to validate that the requester has permissions to the enpoint, if authorization is denied AzAPICall returns 'failed'. (Using `-validateAccess` will set `noPaging` to `true`) | |
| skipOnErrorCode | `int32[]` | In some cases _(e.g. trying to add a user to a group were the user is already a member of)_ the API responde with an http status code 400. This is an expected error. To not throw an error and exit the script, you can use this parameter and set an expected error status code like `400`. You can also pass multiple errorcodes e.g. `-skipOnErrorCode 400,409` | |
Expand Down
Binary file modified pwsh/module/build/AzAPICall.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions pwsh/module/build/AzAPICall/AzAPICall.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AzAPICall.psm1'

# Version number of this module.
ModuleVersion = '1.1.86'
ModuleVersion = '1.2.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand All @@ -30,7 +30,7 @@
Copyright = '(c) All rights reserved.'

# Description of the functionality provided by this module
Description = 'Azure API call handler for Microsoft Graph, Azure Resource Management, KeyVault and Log Analytics. Visit aka.ms/AzAPICall'
Description = 'Azure API call handler for Microsoft Graph, Azure Resource Management, KeyVault, Log Analytics, Storage and ingest.monitor.azure.*. Visit aka.ms/AzAPICall'

# Minimum version of the PowerShell engine required by this module
# PowerShellVersion = '7.0.3'
Expand Down
Loading

0 comments on commit 492f55a

Please sign in to comment.