az login
token=($(az account get-access-token --resource https://graph.microsoft.com))
echo $token | jq
-->
import requests | |
from azure.identity import DefaultAzureCredential | |
NAMESPACE_NAME = "namespace_name" | |
SUBSCRIPTION_ID = "subscription_id" | |
RESOURCE_GROUP = "resource-group" | |
AUTHORIZATION_RULE = "RootManageSharedAccessKey" | |
API_VERSION = "2021-11-01" | |
import uuid | |
from datetime import datetime | |
from typing import Optional | |
import typer | |
from azure.servicebus import ServiceBusClient, ServiceBusMessage | |
from my_api.service_principals import filter_my_service_principals, create_secret | |
from my_api.auth import get_token | |
from my_api.config import Settings |
import uuid | |
from datetime import datetime | |
from typing import Optional | |
import typer | |
from azure.servicebus import ServiceBusClient, ServiceBusMessage | |
from my_api.api.service_principals import filter_my_service_principals, create_secret | |
from my_api.auth import get_token | |
from my_api.config import Settings |
import typer | |
from azure.identity import DefaultAzureCredential | |
from azure.mgmt.storage import StorageManagementClient | |
from azure.data.tables import TableServiceClient | |
from azure.core.exceptions import HttpResponseError | |
TABLE_NAME = "my_table" | |
SUBSCRIPTION_ID = "subscription_id" | |
RESOURCE_GROUP = "resource_group" |
import datetime | |
from dateutil.relativedelta import * | |
import maya | |
from dateutil import parser | |
import timeit | |
test = ['2023-01-15T20:56:24Z', '2023-12-15T14:47:33.049Z', '2023-01-21T15:28:50Z', '2023-01-21T15:29:33Z', | |
'2023-01-21T15:29:40Z', '2023-01-21T15:29:47Z', '2023-01-21T15:29:54Z', '2023-01-25T09:51:44Z', | |
'2023-01-25T09:51:51Z', '2023-01-25T09:51:57Z', '2023-01-31T14:05:43Z', '2023-01-31T14:05:48Z', | |
'2023-01-31T14:05:54Z', '2023-01-31T14:06:01Z', '2023-02-03T14:41:42Z', '2023-02-10T13:05:57Z', |
from azure.identity import DefaultAzureCredential | |
from azure.mgmt.storage import StorageManagementClient | |
STORAGE_ACCOUNT_NAME = "storage_account_name" | |
SUBSCRIPTION_ID = "subscription_id" | |
RESOURCE_GROUP = "resource_group" | |
def get_storage_account_connection_string() -> Optional[str]: | |
""" | |
Returns : connection string |
from azure.data.tables import TableClient | |
import get_storage_account_connection_string | |
STORAGE_ACCOUNT_NAME = "storage_account_name" | |
def read_keyvault_from_storage_table(display_name: str) -> Optional[str]: | |
""" | |
Parameters | |
---------- | |
display_name : service principal name |
df
command to get a detailed report on the system’s disk space usage.df -h
The output
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/disk3s1s1 926Gi 20Gi 803Gi 3% 502068 4293294021 0% /
devfs 205Ki 205Ki 0Bi 100% 710 0 100% /dev
/dev/disk3s6 926Gi 7.0Gi 803Gi 1% 7 8418661400 0% /System/Volumes/VM