Skip to content

Instantly share code, notes, and snippets.

GET /subscriptions/{{subscription}}/resourceGroups/{{resource_group}}/providers/Microsoft.Network/frontdoors/{{front_door}}?api-version=2020-01-01 HTTP/1.1
Host: management.azure.com
Content-Type: application/json
Authorization: Bearer
<IfModule authz_core_module>
<RequireAll>
Require expr %{HTTP:X-Azure-FDID} == '{{FDID}}'
</RequireAll>
</IfModule>
{
"ipSecurityRestrictions": [
{
"ipAddress": "13.73.248.16/29",
"action": "Allow",
"tag": "Default",
"priority": 100
},
{
"ipAddress": "20.37.64.104/29",
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"imagetemplatename": {
"value": "customRHELtemplate75"
},
"api-version": {
"value": "2018-02-01-preview"
@smereczynski
smereczynski / policy.json
Created January 24, 2019 16:48
Policy definition for denying deployments where RG or SA does not have tags values for defined tags keys.
{
"if": {
"allOf": [
{
"anyOf": [
{
"field": "type",
"equals": "Microsoft.Resources/subscriptions/resourceGroups"
},
{
@smereczynski
smereczynski / parse_sensors.py
Created September 9, 2018 16:28 — forked from tjeastman/parse_sensors.py
parse "sensors -u" output with Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
class Metric(object):
def __init__(self, adapter_id, sensor_id, sensor_key, value, label):
self._value = self.parse_value(value)
var client_id = pm.environment.get("client_id");
var client_secret = pm.environment.get("client_secret");
var tenant = pm.environment.get("tenant")
pm.sendRequest({
url: 'https://login.microsoftonline.com/' + tenant + '/oauth2/token',
method: 'POST',
header: {
'Content-Type': 'multipart/form-data',
FROM smereczynski/docker-azure-sdk-for-python:python3.6
ADD run.py /
CMD [ "python", "./run.py" ]
FROM python:3.6
ADD run.py /
RUN pip install azure keyrings.alt
CMD [ "python", "./run.py" ]
FROM python:3.6
ADD run.py /
RUN pip install azure keyrings.alt