Microsoft.Azure.Commands.Batch.Models.BatchClient.GetStorageUrl C# (CSharp) Method

GetStorageUrl() private method

private GetStorageUrl ( string resourceGroupName, string accountName, string applicationId, string version, bool &didCreateAppPackage ) : string
resourceGroupName string
accountName string
applicationId string
version string
didCreateAppPackage bool
return string
        private string GetStorageUrl(string resourceGroupName, string accountName, string applicationId, string version, out bool didCreateAppPackage)
        {
            try
            {
                // Checks to see if the package exists
                ApplicationPackage response = BatchManagementClient.ApplicationPackage.Get(
                    resourceGroupName,
                    accountName,
                    applicationId,
                    version);

                didCreateAppPackage = false;
                return response.StorageUrl;
            }
            catch (CloudException exception)
            {
                // If the application package is not found we want to create a new application package.
                if (exception.Response.StatusCode != HttpStatusCode.NotFound)
                {
                    var message = string.Format(Resources.FailedToGetApplicationPackage, applicationId, version, exception.Message);
                    throw new CloudException(message, exception);
                }
            }

            try
            {
                ApplicationPackage addResponse = BatchManagementClient.ApplicationPackage.Create(
                    resourceGroupName,
                    accountName,
                    applicationId,
                    version);

                // If Application was created we need to return a flag.
                didCreateAppPackage = true;
                return addResponse.StorageUrl;
            }
            catch (Exception exception)
            {
                var message = string.Format(Resources.FailedToAddApplicationPackage, applicationId, version, exception.Message);
                throw new NewApplicationPackageException(message, exception);
            }
        }
BatchClient