LoginSignup
0
0

More than 5 years have passed since last update.

Azure Resource RateCard API を叩く

Posted at

Azure Resource RateCard API を叩く

備忘録として.

  1. Auzre AD にWeb アプリ/API型のアプリケーションを登録し、サブスクリプションの IAM から所有者の権限を付けておく.

  2. トークンを取得する.

curl -X POST https://login.microsoftonline.com/{TenantID}/oauth2/token \
   -F grant_type=client_credentials \
   -F resource=https://management.core.windows.net/ \
   -F client_id={Application ID} \
   -F client_secret={Key} \
  1. 実際に API を叩く.
curl -L \
   "https://management.azure.com/subscriptions/{SubscriptionID}/providers/Microsoft.Commerce/RateCard?api-version=2016-08-31-preview&%24filter=OfferDurableId+eq+'MS-AZR-0003p'+and+Currency+eq+'USD'+and+Locale+eq+'en-US'+and+RegionInfo+eq+'US'" \
   -H 'ContentType: application/json' \
   -H 'Authorization: Bearer {Token}'
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0