| external help file | utils-help.xml |
|---|---|
| Module Name | utils |
| online version | |
| schema | 2.0.0 |
Invokes an Azure REST API then returns the response.
Invoke-AzureRestApi -Method <String> -SubscriptionId <String> -ResourceProviderName <String>
-ResourceType <String> -ApiVersion <String> [-QueryString <String>] [-RequestBody <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Invoke-AzureRestApi -Method <String> -SubscriptionId <String> -ResourceGroupName <String>
-ResourceProviderName <String> -ResourceType <String> -Name <String> -ApiVersion <String>
[-QueryString <String>] [-RequestBody <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
The Invoke-AzureRestApi function invokes an Azure REST API with the specified parameters then return the response.
$response = Invoke-AzureRestApi -Method 'GET' -SubscriptionId '11111111-1111-1111-1111-111111111111' -ResourceProviderName 'Microsoft.ResourceHealth' -ResourceType 'events' -ApiVersion '2024-02-01' -QueryString 'queryStartTime=2024-10-02T00:00:00'
The HTTP method to invoke the Azure REST API. The accepted values are GET, POST, PUT, PATCH, and DELETE.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe subscription ID that constitutes the URI for invoke the Azure REST API.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe resource group name that constitutes the URI for invoke the Azure REST API.
Type: String
Parameter Sets: WithResourceGroup
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe resource provider name that constitutes the URI for invoke the Azure REST API. It's usually as the XXXX.XXXX format.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe resource type that constitutes the URI for invoke the Azure REST API.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe resource name that constitutes the URI for invoke the Azure REST API.
Type: String
Parameter Sets: WithResourceGroup
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe Azure REST API version that constitutes the URI for invoke the Azure REST API. It's usually as the yyyy-mm-dd format.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe query string that constitutes the URI for invoke the Azure REST API.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe request body for invoke the Azure REST API.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Author: Takeshi Katano Date: 2024-10-23
This function requires the Az.Accounts module to be installed and imported. This function should be placed in a common module such as a utility/helper module because the capability of this function is common across modules.