Microsoft.WindowsAzure.Commands.Utilities.CloudService.PublishContext.ConfigPackageSettings C# (CSharp) Method

ConfigPackageSettings() public method

public ConfigPackageSettings ( string package, string workingDirectory ) : void
package string
workingDirectory string
return void
        public void ConfigPackageSettings(string package, string workingDirectory)
        {
            PackagePath = package;
            PackageIsFromStorageAccount = IsStorageAccountUrl(package);
            if (!PackageIsFromStorageAccount)
            {
                if (!Path.IsPathRooted(package))
                {
                    PackagePath = Path.Combine(workingDirectory, package);
                }
            }
        }

Usage Example

示例#1
0
        public Deployment PublishCloudService(
            string package,
            string configuration,
            string slot           = null,
            string location       = null,
            string affinityGroup  = null,
            string storageAccount = null,
            string deploymentName = null,
            bool launch           = false,
            bool forceUpgrade     = false)
        {
            string workingDirectory = GetCurrentDirectory();

            string cloudConfigFullPath = configuration;

            if (!Path.IsPathRooted(configuration))
            {
                cloudConfigFullPath = Path.Combine(workingDirectory, configuration);
            }

            CloudServiceProject cloudServiceProject = new CloudServiceProject(cloudConfigFullPath);

            // Initialize publish context
            PublishContext context = CreatePublishContext(
                cloudServiceProject.ServiceName,
                slot,
                location,
                affinityGroup,
                storageAccount,
                deploymentName,
                cloudServiceProject);

            context.ConfigPackageSettings(package, workingDirectory);

            // Verify storage account exists
            if (!context.PackageIsFromStorageAccount)
            {
                SetupStorageService(context);
            }

            WriteVerbose(string.Format(Resources.PublishServiceStartMessage, context.ServiceName));

            DeploymentGetResponse deployment = DeployPackage(launch, forceUpgrade, context);

            return(new Deployment(deployment));
        }