示例#1
0
        protected override Task ExecuteCreateAsync()
        {
            var definition = Azure
                             .WithSubscription(Options.SubscriptionId)
                             .StorageAccounts.Define(AccountName)
                             .WithRegion(Options.Region);

            IWithCreate create = Options.UseExistingResourceGroup
                ? definition.WithExistingResourceGroup(Options.ResourceGroupName)
                : definition.WithNewResourceGroup(Options.ResourceGroupName);

            return(create.WithBlobStorageAccountKind()
                   .CreateAsync());
        }
示例#2
0
        protected override Task ExecuteCreateAsync()
        {
            var definition = Azure
                             .WithSubscription(Options.SubscriptionId)
                             .AppServices.FunctionApps
                             .Define(AppName)
                             .WithRegion(Options.Region);

            var create = Options.UseExistingResourceGroup
                ? definition.WithExistingResourceGroup(Options.ResourceGroupName)
                : definition.WithNewResourceGroup(Options.ResourceGroupName);

            return(create.CreateAsync());
        }
        protected override Task ExecuteCreateAsync()
        {
            var definition = Azure
                             .WithSubscription(Options.SubscriptionId)
                             .WebApps.Define(AppName)
                             .WithRegion(Options.Region);

            IWithNewAppServicePlan create = Options.UseExistingResourceGroup
                ? definition.WithExistingResourceGroup(Options.ResourceGroupName)
                : definition.WithNewResourceGroup(Options.ResourceGroupName);

            return(create
                   .WithNewWindowsPlan(PricingTier.FreeF1)
                   .CreateAsync());
        }
        protected override Task ExecuteCreateAsync()
        {
            var definition = Azure
                             .WithSubscription(Options.SubscriptionId)
                             .Vaults.Define(VaultName)
                             .WithRegion(Options.Region);

            var withPolicy = Options.UseExistingResourceGroup
                ? definition.WithExistingResourceGroup(Options.ResourceGroupName)
                : definition.WithNewResourceGroup(Options.ResourceGroupName);

            return(withPolicy
                   .WithEmptyAccessPolicy()
                   .CreateAsync());
        }
        protected override Task ExecuteCreateAsync()
        {
            var definition = Azure
                             .WithSubscription(Options.SubscriptionId)
                             .CosmosDBAccounts.Define(DocDbName)
                             .WithRegion(Options.Region);

            IWithKind kind = Options.UseExistingResourceGroup
                ? definition.WithExistingResourceGroup(Options.ResourceGroupName)
                : definition.WithNewResourceGroup(Options.ResourceGroupName);

            return(kind
                   .WithKind(DatabaseAccountKind.GlobalDocumentDB)
                   .WithSessionConsistency()
                   .WithWriteReplication(Options.Region)
                   .WithReadReplication(Options.Region)
                   .CreateAsync());
        }
示例#6
0
        protected override async Task ExecuteCreateAsync()
        {
            var definition = Azure
                             .WithSubscription(Options.SubscriptionId)
                             .SqlServers.Define(ServerName)
                             .WithRegion(Options.Region);

            IWithAdministratorLogin withLogin = Options.UseExistingResourceGroup
                ? definition.WithExistingResourceGroup(Options.ResourceGroupName)
                : definition.WithNewResourceGroup(Options.ResourceGroupName);

            var sqlServer = await withLogin
                            .WithAdministratorLogin("demo")
                            .WithAdministratorPassword("P@assw0rd")
                            .CreateAsync();

            var database = await sqlServer.Databases.Define($"{ServerName}_db")
                           .WithEdition(DatabaseEditions.Basic)
                           .CreateAsync();
        }
示例#7
0
        protected override Task ExecuteCreateAsync()
        {
            var definition = Azure
                             .WithSubscription(Options.SubscriptionId)
                             .VirtualMachines
                             .Define(VirtualMachineName)
                             .WithRegion(Options.Region);

            var withReasourceGroup = Options.UseExistingResourceGroup
                ? definition.WithExistingResourceGroup(Options.ResourceGroupName)
                : definition.WithNewResourceGroup(Options.ResourceGroupName);

            var create = withReasourceGroup
                         .WithNewPrimaryNetwork("10.0.0.0/6")
                         .WithPrimaryPrivateIPAddressDynamic()
                         .WithNewPrimaryPublicIPAddress("mywindowsvmdns")
                         .WithPopularWindowsImage(KnownWindowsVirtualMachineImage.WindowsServer2012R2Datacenter)
                         .WithAdminUsername("andre")
                         .WithAdminPassword("p4ssw0rd")
                         .WithSize(VirtualMachineSizeTypes.BasicA0);

            return(create.CreateAsync());
        }