import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
microsoft_azure_monitor: {
type: "app",
app: "microsoft_azure_monitor",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://management.azure.com/subscriptions`,
headers: {
Authorization: `Bearer ${this.microsoft_azure_monitor.$auth.oauth_access_token}`,
},
params: {
"api-version": `2020-01-01`,
},
})
},
})
Microsoft Azure Monitor uses OAuth authentication. When you connect your Microsoft Azure Monitor account, Pipedream will open a popup window where you can sign into Microsoft Azure Monitor and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Microsoft Azure Monitor API.
Pipedream requests the following authorization scopes when you connect your account:
https://management.azure.com/.defaultPOSThttps://login.microsoftonline.com/{{custom_fields.tenant_id}}/oauth2/v2.0/tokencontent-type: application/x-www-form-urlencodedaccept: application/jsonclient_id={{custom_fields.client_id}}&client_secret={{custom_fields.client_secret}}&grant_type=client_credentials&scope={{oauth.space_separated_scopes}}POSThttps://login.microsoftonline.com/{{custom_fields.tenant_id}}/oauth2/v2.0/tokencontent-type: application/x-www-form-urlencodedaccept: application/jsonclient_id={{custom_fields.client_id}}&client_secret={{custom_fields.client_secret}}&grant_type=client_credentials&scope={{oauth.space_separated_scopes}}