profile
viewpoint

Ask questionsSupport query_string in resource provider

I don't know if this is normal but Microsoft Azure seems to think so.

For all http methods it's expected to include a query string for api version to use.

Here's an example with PUT ` PUT /subscriptions/.../resourcegroups/ExampleResourceGroup?api-version=2016-02-01 HTTP/1.1 Authorization: Bearer <bearer-token> Content-Length: 29 Content-Type: application/json Host: management.azure.com

{ "location": "West US" } ` Now I don't know if this is normal but having this supported in rest provider will allow me to manage resources not supported by terraforms azurerm provider.

Mastercard/terraform-provider-restapi

Answer questions sponte

Thanks for getting back to me @abelal83, in the meantime I have come up with a simple Powershell for it:

[CmdletBinding()]
param(
  [Parameter(Mandatory = $true)]
  [string] $TenantId,

  [Parameter(Mandatory = $true)]
  [string] $ClientId,

  [Parameter(Mandatory = $true)]
  [SecureString] $ClientSecret
)

$secret = $ClientSecret | ConvertFrom-SecureString -AsPlainText

$request = @{
  grant_type    = "client_credentials"
  client_id     = $ClientId
  client_secret = $secret
  resource      = "https://management.azure.com/"
}

$response = Invoke-RestMethod "https://login.microsoftonline.com/${TenantId}/oauth2/token?" `
  -Method POST `
  -Form $request

$response
useful!
source:https://uonfu.com/
Github User Rank List