Invoke-AzRestMethod
Alleen HTTP-aanvraag maken en uitvoeren naar azure-eindpunt voor resourcebeheer
Notitie
Dit is de vorige versie van onze documentatie. Raadpleeg de meest recente versie voor actuele informatie.
Syntax
Invoke-AzRestMethod
-Path <String>
[-Method <String>]
[-Payload <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Invoke-AzRestMethod
[-SubscriptionId <String>]
[-ResourceGroupName <String>]
[-ResourceProviderName <String>]
[-ResourceType <String[]>]
[-Name <String[]>]
-ApiVersion <String>
[-Method <String>]
[-Payload <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Invoke-AzRestMethod
[-Uri] <Uri>
[-ResourceId <Uri>]
[-Method <String>]
[-Payload <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Alleen HTTP-aanvraag maken en uitvoeren naar azure-eindpunt voor resourcebeheer
Voorbeelden
Voorbeeld 1
Invoke-AzRestMethod -Path "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}?api-version={API}" -Method GET
Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [x-ms-request-id, System.String[]], [Strict-Transport-Security, System.String[]]…}
Version : 1.1
StatusCode : 200
Method : GET
Content : {
"properties": {
"source": "Azure",
"customerId": "{customerId}",
"provisioningState": "Succeeded",
"sku": {
"name": "pergb2018",
"maxCapacityReservationLevel": 3000,
"lastSkuUpdate": "Mon, 25 May 2020 11:10:01 GMT"
},
"retentionInDays": 30,
"features": {
"legacy": 0,
"searchVersion": 1,
"enableLogAccessUsingOnlyResourcePermissions": true
},
"workspaceCapping": {
"dailyQuotaGb": -1.0,
"quotaNextResetTime": "Thu, 18 Jun 2020 05:00:00 GMT",
"dataIngestionStatus": "RespectQuota"
},
"enableFailover": false,
"publicNetworkAccessForIngestion": "Enabled",
"publicNetworkAccessForQuery": "Enabled",
"createdDate": "Mon, 25 May 2020 11:10:01 GMT",
"modifiedDate": "Mon, 25 May 2020 11:10:02 GMT"
},
"id": "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}",
"name": "{workspace}",
"type": "Microsoft.OperationalInsights/workspaces",
"location": "eastasia",
"tags": {}
}
Haal de Log Analytics-werkruimte op pad op. Het biedt alleen ondersteuning voor de API van het beheervlak en de hostnaam van Azure Resource Manager wordt toegevoegd volgens de azure-omgevingsinstelling.
Voorbeeld 2
Invoke-AzRestMethod https://graph.microsoft.com/v1.0/me
Headers : {[Date, System.String[]], [Cache-Control, System.String[]], [Transfer-Encoding, System.String[]], [Strict-Transport-Security, System.String[]]…}
Version : 1.1
StatusCode : 200
Method : GET
Content : {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":["......}
Vraag de huidige aangemelde gebruiker op via MicrosoftGraph API. Dit voorbeeld is gelijk aan Get-AzADUser -SignedIn.
Parameters
API-versie
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Cmdlet op de achtergrond uitvoeren
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Hiermee wordt u gevraagd om bevestiging voordat u de cmdlet uitvoert.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
De referenties, het account, de tenant en het abonnement dat wordt gebruikt voor communicatie met Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Http-methode
| Type: | String |
| Accepted values: | GET, POST, PUT, PATCH, DELETE |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
lijst met doelresourcenaam
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Pad van doelresource-URL. De hostnaam van Resource Manager mag niet worden toegevoegd.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Nettolading van JSON-indeling
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Naam van doelresourcegroep
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Id-URI die is opgegeven door de REST API die u aanroept. Dit mag niet de resource-id van Azure Resource Manager zijn.
| Type: | Uri |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Naam van doelresourceprovider
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Lijst met doelresourcetype
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Doelabonnements-id
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Uniform Resource Identifier van de Azure-resources. De doelresource moet ondersteuning bieden voor Azure AD verificatie en het toegangstoken wordt afgeleid op basis van de resource-id. Als de resource-id niet is ingesteld, wordt de waarde ervan afgeleid op basis van ingebouwde serviceachtervoegsels in de huidige Azure-omgeving.
| Type: | Uri |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Hiermee wordt weergegeven wat er zou gebeuren als u de cmdlet uitvoert. De cmdlet wordt niet uitgevoerd.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Invoerwaarden
System.string