How to use @azure/arm-resources - 8 common examples

To help you get started, we’ve selected a few @azure/arm-resources examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / ng-deploy-azure / src / util / azure / resource-group-helper.ts View on Github external
export async function createResourceGroup(
  name: string,
  subscription: string,
  creds: DeviceTokenCredentials,
  location: string
): Promise {
  // TODO: throws an error here if the subscription is wrong
  const client = new ResourceManagementClient(creds, subscription);
  const resourceGroupRes = await client.resourceGroups.createOrUpdate(name, {
    location
  });
  return resourceGroupRes;
}
github serverless / serverless-azure-functions / src / services / armService.ts View on Github external
public constructor(serverless: Serverless, options: ServerlessAzureOptions) {
    super(serverless, options);
    this.resourceClient = new ResourceManagementClient(this.credentials, this.subscriptionId);
  }
github HomecareHomebase / azure-bake / ingredient / ingredient-availability-set / src / functions.ts View on Github external
public async get_update_domain_count(): Promise {
        
        let util = IngredientManager.getIngredientFunction("coreutils", this.context);
        let client = new ResourceManagementClient(this.context.AuthToken, this.context.Environment.authentication.subscriptionId);

        let availResource = await client.resources.get(await util.resource_group(), "Microsoft.Compute", "", "availabilitySets", name, "2018-06-01");

        return availResource.properties.platformUpdateDomainCount;
    }
}
github Azure / ng-deploy-azure / src / util / azure / resource-group-helper.ts View on Github external
export async function getResourceGroups(creds: DeviceTokenCredentials, subscription: string) {
  const client = new ResourceManagementClient(creds, subscription);
  const resourceGroupList = (await client.resourceGroups.list()) as ResourceGroupDetails[];
  return resourceGroupList;
}
github serverless / serverless-azure-functions / src / services / resourceService.ts View on Github external
public constructor(serverless: Serverless, options: Serverless.Options) {
    super(serverless, options);

    this.resourceClient = new ResourceManagementClient(this.credentials, this.subscriptionId);
  }
github tmobile / jazz / builds / jazz_azure-create-service / components / ClientFactory.js View on Github external
constructor(clientId, clientSecret, tenantId, subscriptionId) {

        this.clientId = clientId;
        this.clientSecret = clientSecret;
        this.tenantId = tenantId;
        this.subscriptionId = subscriptionId;

        this.classList = new Map();
        this.classList.set('WebSiteManagementClient', WebSiteManagementClient);
        this.classList.set('ResourceManagementClient', ResourceManagementClient);
        this.classList.set('StorageManagementClient', StorageManagementClient);
        this.classList.set('ApiManagementClient', ApiManagementClient);
        this.classList.set('CdnManagementClient', CdnManagementClient);
        this.classList.set('CosmosDBManagementClient', CosmosDBManagementClient);
        this.classList.set('EventHubManagementClient', EventHubManagementClient);
        this.classList.set('ServiceBusManagementClient', ServiceBusManagementClient);

        this.instanceList = new Map();
    }
github HomecareHomebase / azure-bake / ingredient / ingredient-availability-set / src / functions.ts View on Github external
public async get_fault_domain_count(): Promise {
        
        let util = IngredientManager.getIngredientFunction("coreutils", this.context);
        let client = new ResourceManagementClient(this.context.AuthToken, this.context.Environment.authentication.subscriptionId);

        let availResource = await client.resources.get(await util.resource_group(), "Microsoft.Compute", "", "availabilitySets", name, "2018-06-01");

        return availResource.properties.platformFaultDomainCount;
    }
github taskcluster / taskcluster / infrastructure / tooling / src / dev / azure.js View on Github external
const azureResources = async ({userConfig, answer, configTmpl}) => {
  userConfig.auth = userConfig.auth || {};
  if (!userConfig.auth.azure_account_key || !userConfig.queue.azure_account_key) {
    const resourceGroupName = answer.azureAccountId || userConfig.azureAccountId;
    const location = (answer.meta || {}).azureRegion || (userConfig.meta || {}).azureRegion;
    const creds = await msRestNodeAuth.interactiveLogin();
    const subscriptionId = answer.meta.azureSubscriptionId || userConfig.meta.azureSubscriptionId;

    const resourceClient = new ResourceManagementClient(creds, subscriptionId);

    await resourceClient.resourceGroups.createOrUpdate(resourceGroupName, {
      location,
      tags: {},
    });

    const storageClient = new StorageManagementClient(creds, subscriptionId);
    await storageClient.storageAccounts.create(
      resourceGroupName,
      resourceGroupName,
      {
        sku: {
          name: 'Standard_RAGRS',
        },
        kind: 'Storage',
        location,

@azure/arm-resources

A generated SDK for ResourceManagementClient.

MIT
Latest version published 1 year ago

Package Health Score

79 / 100
Full package analysis

Popular @azure/arm-resources functions