Skip to content

Commit 9e914e6

Browse files
KennethHarmonKenneth HarmonNoriZC
authored
Fix bug where New-AzBatchApplicationPackage wouldn't work if allowUpdates was False (#24941)
* Fix logical error in GetStorageUri Function of BatchClient.ApplicationPackages * Update Changelog * Update ChangeLog.md We usaully put the latest changelog to the head of Upcoming session to avoid mismerge --------- Co-authored-by: Kenneth Harmon <[email protected]> Co-authored-by: NoriZC <[email protected]>
1 parent 372785f commit 9e914e6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Batch/Batch/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fixed a bug where `New-AzBatchApplicationPackage` wouldn't work if the application `AllowUpdates` parameter was set to `$false`.
2122

2223
## Version 3.6.1
2324
* Removed the out-of-date breaking change message for `Get-AzBatchCertificate` and `New-AzBatchCertificate`.

src/Batch/Batch/Models/BatchClient.ApplicationPackages.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ private void ActivateApplicationPackage(string resourceGroupName, string account
189189
}
190190
}
191191

192-
private string GetStorageUrl(string resourceGroupName, string accountName, string applicationName, string version, out bool didCreateAppPackage)
192+
private string GetStorageUrl(string resourceGroupName, string accountName, string applicationName, string version, out bool appPackageAlreadyExists)
193193
{
194194
try
195195
{
@@ -200,7 +200,7 @@ private string GetStorageUrl(string resourceGroupName, string accountName, strin
200200
applicationName,
201201
version);
202202

203-
didCreateAppPackage = false;
203+
appPackageAlreadyExists = true;
204204
return response.StorageUrl;
205205
}
206206
catch (CloudException exception)
@@ -221,8 +221,8 @@ private string GetStorageUrl(string resourceGroupName, string accountName, strin
221221
applicationName,
222222
version);
223223

224-
// If Application was created we need to return a flag.
225-
didCreateAppPackage = true;
224+
//Package didn't exist before we created it
225+
appPackageAlreadyExists = false;
226226
return addResponse.StorageUrl;
227227
}
228228
catch (Exception exception)

0 commit comments

Comments
 (0)