Esempio n. 1
0
        public override void ExecuteCmdlet()
        {
            var parameters = new CreatePSDataFactoryParameters()
            {
                ResourceGroupName = ResourceGroupName,
                DataFactoryName   = Name,
                Location          = Location,
                Tags          = Tag,
                Force         = Force.IsPresent,
                ConfirmAction = ConfirmAction
            };

            WriteObject(DataFactoryClient.CreatePSDataFactory(parameters));
        }
Esempio n. 2
0
        public override void ExecuteCmdlet()
        {
            this.ValidateParameters();

            FactoryRepoConfiguration repoConfiguration = null;

            if (!string.IsNullOrWhiteSpace(this.ProjectName) || !string.IsNullOrWhiteSpace(this.TenantId))
            {
                var factoryVSTSConfiguration = new FactoryVSTSConfiguration();
                factoryVSTSConfiguration.ProjectName = this.ProjectName;
                factoryVSTSConfiguration.TenantId    = this.TenantId;

                repoConfiguration = factoryVSTSConfiguration;
            }
            else if (!string.IsNullOrWhiteSpace(this.HostName))
            {
                var factoryGitHubConfiguration = new FactoryGitHubConfiguration();
                factoryGitHubConfiguration.HostName = this.HostName;

                repoConfiguration = factoryGitHubConfiguration;
            }

            if (repoConfiguration != null)
            {
                repoConfiguration.CollaborationBranch = this.CollaborationBranch;
                repoConfiguration.AccountName         = this.AccountName;
                repoConfiguration.LastCommitId        = this.LastCommitId;
                repoConfiguration.RootFolder          = this.RootFolder;
                repoConfiguration.RepositoryName      = this.RepositoryName;
            }

            var parameters = new CreatePSDataFactoryParameters()
            {
                ResourceGroupName = ResourceGroupName,
                DataFactoryName   = Name,
                Location          = Location,
                Tags              = Tag,
                Force             = Force.IsPresent,
                RepoConfiguration = repoConfiguration,
                ConfirmAction     = ConfirmAction,
                GlobalParameters  = GlobalParameterDefinition
            };

            WriteObject(DataFactoryClient.CreatePSDataFactory(parameters));
        }
Esempio n. 3
0
        public override void ExecuteCmdlet()
        {
            this.ValidateParameters();

            FactoryRepoConfiguration repoConfiguration = null;

            if (!string.IsNullOrWhiteSpace(this.ProjectName) || !string.IsNullOrWhiteSpace(this.TenantId))
            {
                var factoryVSTSConfiguration = new FactoryVSTSConfiguration();
                factoryVSTSConfiguration.ProjectName = this.ProjectName;
                factoryVSTSConfiguration.TenantId    = this.TenantId;

                repoConfiguration = factoryVSTSConfiguration;
            }
            else if (!string.IsNullOrWhiteSpace(this.HostName))
            {
                var factoryGitHubConfiguration = new FactoryGitHubConfiguration();
                factoryGitHubConfiguration.HostName = this.HostName;

                repoConfiguration = factoryGitHubConfiguration;
            }

            if (repoConfiguration != null)
            {
                repoConfiguration.CollaborationBranch = this.CollaborationBranch;
                repoConfiguration.AccountName         = this.AccountName;
                repoConfiguration.LastCommitId        = this.LastCommitId;
                repoConfiguration.RootFolder          = this.RootFolder;
                repoConfiguration.RepositoryName      = this.RepositoryName;
            }

            string factoryIdentityType = FactoryIdentityType.SystemAssigned;

            if (!string.IsNullOrWhiteSpace(this.IdentityType))
            {
                factoryIdentityType = this.IdentityType;
            }

            if (this.UserAssignedIdentity != null && this.UserAssignedIdentity.Count > 0)
            {
                if (!factoryIdentityType.ToLower().Contains(FactoryIdentityType.UserAssigned.ToLower()))
                {
                    factoryIdentityType = FactoryIdentityType.SystemAssignedUserAssigned;
                }
            }
            FactoryIdentity factoryIdentity = new FactoryIdentity(factoryIdentityType, userAssignedIdentities: this.UserAssignedIdentity);

            EncryptionConfiguration encryption = null;

            if (!string.IsNullOrWhiteSpace(this.EncryptionVaultBaseUrl) && !string.IsNullOrWhiteSpace(this.EncryptionKeyName))
            {
                CMKIdentityDefinition cmkIdentity = null;
                if (!string.IsNullOrWhiteSpace(this.EncryptionUserAssignedIdentity))
                {
                    cmkIdentity = new CMKIdentityDefinition(this.EncryptionUserAssignedIdentity);
                }
                encryption = new EncryptionConfiguration(this.EncryptionKeyName, this.EncryptionVaultBaseUrl, this.EncryptionKeyVersion, cmkIdentity);
            }

            string publicNetworkAccess = Management.DataFactory.Models.PublicNetworkAccess.Enabled;

            if (!string.IsNullOrWhiteSpace(this.PublicNetworkAccess))
            {
                publicNetworkAccess = this.PublicNetworkAccess;
            }

            var parameters = new CreatePSDataFactoryParameters()
            {
                ResourceGroupName       = ResourceGroupName,
                DataFactoryName         = Name,
                Location                = Location,
                PublicNetworkAccess     = publicNetworkAccess,
                EncryptionConfiguration = encryption,
                FactoryIdentity         = factoryIdentity,
                Tags              = Tag,
                Force             = Force.IsPresent,
                RepoConfiguration = repoConfiguration,
                ConfirmAction     = ConfirmAction,
                GlobalParameters  = GlobalParameterDefinition
            };

            WriteObject(DataFactoryClient.CreatePSDataFactory(parameters));
        }