Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

.NET Core C# Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Bitfinex v2 REST
Bluzone
BrickLink
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
Jira
Lightspeed
MYOB
Magento
Mailgun
Mastercard

MedTunnel
MercadoLibre
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
Trello
Twilio
Twitter
UniPin
VoiceBase
Vonage
Walmart
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yousign
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(.NET Core C#) Azure List Storage Accounts

Demonstrates how to list Azure storage accounts.

Chilkat .NET Downloads

Chilkat .NET Assemblies

Chilkat for .NET Core

Chilkat for Mono

// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

Chilkat.Http http = new Chilkat.Http();

// Load an OAuth2 access token previously fetched by this example:  Get Azure OAuth2 Access Token
Chilkat.JsonObject jsonToken = new Chilkat.JsonObject();
bool success = jsonToken.LoadFile("qa_data/tokens/azureToken.json");
// Assuming success..
http.AuthToken = jsonToken.StringOf("access_token");
Debug.WriteLine("AuthToken: " + http.AuthToken);

http.Accept = "application/json";

string url = "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts?api-version=2018-11-01";

string jsonResp = http.QuickGetStr(url);
if (http.LastMethodSuccess != true) {
    Debug.WriteLine(http.LastErrorText);
    return;
}

Debug.WriteLine("Response Status Code: " + Convert.ToString(http.LastStatus));

Chilkat.JsonObject json = new Chilkat.JsonObject();
json.Load(jsonResp);
json.EmitCompact = false;
Debug.WriteLine(json.Emit());

if (http.LastStatus != 200) {
    Debug.WriteLine("Failed.");
    return;
}

// Sample output...
// (See the parsing code below..)
// 
// Use this online tool to generate parsing code from sample JSON: 
// Generate Parsing Code from JSON

// {
//   "value": [
//     {
//       "sku": {
//         "name": "Standard_LRS",
//         "tier": "Standard"
//       },
//       "kind": "Storage",
//       "id": "/subscriptions/6c42643b-ebef-45e0-b917-b3583b84a57f/resourceGroups/gchilkat/providers/Microsoft.Storage/storageAccounts/chilkat",
//       "name": "chilkat",
//       "type": "Microsoft.Storage/storageAccounts",
//       "location": "eastus",
//       "tags": {},
//       "properties": {
//         "networkAcls": {
//           "bypass": "AzureServices",
//           "virtualNetworkRules": [
//           ],
//           "ipRules": [
//           ],
//           "defaultAction": "Allow"
//         },
//         "supportsHttpsTrafficOnly": true,
//         "encryption": {
//           "services": {
//             "file": {
//               "enabled": true,
//               "lastEnabledTime": "2017-12-28T11:02:10.6840887Z"
//             },
//             "blob": {
//               "enabled": true,
//               "lastEnabledTime": "2017-12-28T11:02:10.6840887Z"
//             }
//           },
//           "keySource": "Microsoft.Storage"
//         },
//         "provisioningState": "Succeeded",
//         "creationTime": "2016-04-18T22:57:36.5377065Z",
//         "primaryEndpoints": {
//           "blob": "https://chilkat.blob.core.windows.net/",
//           "queue": "https://chilkat.queue.core.windows.net/",
//           "table": "https://chilkat.table.core.windows.net/",
//           "file": "https://chilkat.file.core.windows.net/"
//         },
//         "primaryLocation": "eastus",
//         "statusOfPrimary": "available"
//       }
//     }
//   ]
// }
// 

int i;
int count_i;
string skuName;
string skuTier;
string kind;
string id;
string name;
string v_type;
string location;
string propertiesNetworkAclsBypass;
string propertiesNetworkAclsDefaultAction;
bool propertiesSupportsHttpsTrafficOnly;
bool propertiesEncryptionServicesFileEnabled;
string propertiesEncryptionServicesFileLastEnabledTime;
bool propertiesEncryptionServicesBlobEnabled;
string propertiesEncryptionServicesBlobLastEnabledTime;
string propertiesEncryptionKeySource;
string propertiesProvisioningState;
string propertiesCreationTime;
string propertiesPrimaryEndpointsBlob;
string propertiesPrimaryEndpointsQueue;
string propertiesPrimaryEndpointsTable;
string propertiesPrimaryEndpointsFile;
string propertiesPrimaryLocation;
string propertiesStatusOfPrimary;

i = 0;
count_i = json.SizeOfArray("value");
while (i < count_i) {
    json.I = i;
    skuName = json.StringOf("value[i].sku.name");
    skuTier = json.StringOf("value[i].sku.tier");
    kind = json.StringOf("value[i].kind");
    id = json.StringOf("value[i].id");
    name = json.StringOf("value[i].name");
    v_type = json.StringOf("value[i].type");
    location = json.StringOf("value[i].location");
    propertiesNetworkAclsBypass = json.StringOf("value[i].properties.networkAcls.bypass");
    propertiesNetworkAclsDefaultAction = json.StringOf("value[i].properties.networkAcls.defaultAction");
    propertiesSupportsHttpsTrafficOnly = json.BoolOf("value[i].properties.supportsHttpsTrafficOnly");
    propertiesEncryptionServicesFileEnabled = json.BoolOf("value[i].properties.encryption.services.file.enabled");
    propertiesEncryptionServicesFileLastEnabledTime = json.StringOf("value[i].properties.encryption.services.file.lastEnabledTime");
    propertiesEncryptionServicesBlobEnabled = json.BoolOf("value[i].properties.encryption.services.blob.enabled");
    propertiesEncryptionServicesBlobLastEnabledTime = json.StringOf("value[i].properties.encryption.services.blob.lastEnabledTime");
    propertiesEncryptionKeySource = json.StringOf("value[i].properties.encryption.keySource");
    propertiesProvisioningState = json.StringOf("value[i].properties.provisioningState");
    propertiesCreationTime = json.StringOf("value[i].properties.creationTime");
    propertiesPrimaryEndpointsBlob = json.StringOf("value[i].properties.primaryEndpoints.blob");
    propertiesPrimaryEndpointsQueue = json.StringOf("value[i].properties.primaryEndpoints.queue");
    propertiesPrimaryEndpointsTable = json.StringOf("value[i].properties.primaryEndpoints.table");
    propertiesPrimaryEndpointsFile = json.StringOf("value[i].properties.primaryEndpoints.file");
    propertiesPrimaryLocation = json.StringOf("value[i].properties.primaryLocation");
    propertiesStatusOfPrimary = json.StringOf("value[i].properties.statusOfPrimary");
    i = i + 1;
}


 

© 2000-2022 Chilkat Software, Inc. All Rights Reserved.