Ejemplo n.º 1
0
        /// <summary>
        /// Load Application and Service Principal definitions from provided
        /// ApplicationRegistrationDefinition object.
        /// </summary>
        /// <param name="applicationRegistrationDefinition"></param>
        public void Load(ApplicationRegistrationDefinition applicationRegistrationDefinition)
        {
            _serviceApplication   = applicationRegistrationDefinition.ServiceApplication;
            _serviceApplicationSP = applicationRegistrationDefinition.ServiceApplicationSP;

            _clientApplication   = applicationRegistrationDefinition.ClientApplication;
            _clientApplicationSP = applicationRegistrationDefinition.ClientApplicationSP;

            _aksApplication   = applicationRegistrationDefinition.AksApplication;
            _aksApplicationSP = applicationRegistrationDefinition.AksApplicationSP;
            _aksApplicationPasswordCredentialRbacSecret = applicationRegistrationDefinition.AksApplicationRbacSecret;
        }
        /// <summary>
        /// Load Application and Service Principal definitions from provided
        /// ApplicationRegistrationDefinition object.
        /// </summary>
        /// <param name="applicationRegistrationDefinition"></param>
        public void Load(ApplicationRegistrationDefinition applicationRegistrationDefinition)
        {
            // Details of service application
            _serviceApplication       = applicationRegistrationDefinition.ServiceApplication;
            _serviceApplicationSP     = applicationRegistrationDefinition.ServiceApplicationSP;
            _serviceApplicationSecret = applicationRegistrationDefinition.ServiceApplicationSecret;

            // Details of client application
            _clientApplication       = applicationRegistrationDefinition.ClientApplication;
            _clientApplicationSP     = applicationRegistrationDefinition.ClientApplicationSP;
            _clientApplicationSecret = applicationRegistrationDefinition.ClientApplicationSecret;

            // Details of aks application
            _aksApplication       = applicationRegistrationDefinition.AksApplication;
            _aksApplicationSP     = applicationRegistrationDefinition.AksApplicationSP;
            _aksApplicationSecret = applicationRegistrationDefinition.AksApplicationSecret;
        }
        /// <summary>
        /// Dump application registration details as ApplicationRegistrationDefinition object.
        /// </summary>
        /// <returns></returns>
        public ApplicationRegistrationDefinition ToApplicationRegistrationDefinition()
        {
            var definition = new ApplicationRegistrationDefinition(
                // Details of service application
                _serviceApplication,
                _serviceApplicationSP,
                _serviceApplicationSecret,
                // Details of client application
                _clientApplication,
                _clientApplicationSP,
                _clientApplicationSecret,
                // Details of aks application
                _aksApplication,
                _aksApplicationSP,
                _aksApplicationSecret
                );

            return(definition);
        }