sparse-intern-71089
09/19/2018, 7:49 PMwhite-balloon-205
import * as azure from "@pulumi/azure";
async function main(): Promise<string> {
const resourceGroup = await azure.core.getResourceGroup({
name: "appservice-rg24afd37d",
});
return resourceGroup.location;
}
export const location = main();
Note that getResourceGroup
does not appear to return the name
, but you also don't really need it because you can only get the resource group by name anyway, so you could just use that name where needed instead of calling getResourceGroup
. You only need that function if you want to e.g. figure out what location the resource group is in.white-balloon-205
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
async function main(): Promise<pulumi.Output<string>> {
// Get an Azure Resource Group
const resourceGroupName = "appservice-rg24afd37d";
const resourceGroup = await azure.core.getResourceGroup({ name: resourceGroupName });
// Create an Azure resource (Storage Account)
const account = new azure.storage.Account("storage", {
resourceGroupName: resourceGroupName,
location: resourceGroup.location,
accountTier: "Standard",
accountReplicationType: "LRS",
});
return account.primaryConnectionString;
}
export const connectionString = main()
fancy-fall-81083
09/19/2018, 8:18 PMwhite-balloon-205
const azure = require("@pulumi/azure")
async function main() {
const resourceGroup = await azure.core.getResourceGroup({
name: "appservice-rg24afd37d",
});
return resourceGroup.location;
}
exports.location = main();
fancy-fall-81083
09/19/2018, 8:53 PM